automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] {maint} python: extend and improve tests, fix minor glitches


From: Ralf Wildenhues
Subject: Re: [PATCH] {maint} python: extend and improve tests, fix minor glitches
Date: Sun, 13 Feb 2011 12:35:19 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

* Stefano Lattarini wrote on Sun, Feb 13, 2011 at 11:49:28AM CET:
> OK to apply?  I will push in 72 hours if there are no further
> objections.

The patch is OK as it is a strict improvement IIUC, but I still have a
question below.

Thanks,
Ralf

> Subject: [PATCH] python: fix spurious failure in tests
> 
> * tests/python-vars.test: Be laxer in matching the expected values
> of output variables `pythondir' and `pyexecdir', since they can
> change quite unpredictably among different python installations.
> Also, avoid "hyping" debugging output, thus offering smaller trace
> output and more informative diff.

> --- a/tests/python-vars.test
> +++ b/tests/python-vars.test
> @@ -24,21 +24,23 @@ set -e
>  
>  PYTHON=python
>  
> -# Update these if the documentation changes.
> +# Update the definition below if the documentation changes.
> +# Note that the value of the `pythondir' and `pyexecdir' variables can
> +# vary among different python installations, so we need more relaxed
> +# and ad-hoc checks for them.  Also, more proper "functional" checks
> +# on them should be done in the `python-virtualenv.test' test.
>  PYTHON_VERSION=`$PYTHON -c 'import sys; print(sys.version[:3])'` || Exit 1
>  PYTHON_PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'` || Exit 1
>  PYTHON_EXEC_PREFIX='${exec_prefix}'
>  PYTHON_PREFIX='${prefix}'
> -pythondir="\${prefix}/lib/python$PYTHON_VERSION/site-packages"
> -pyexecdir="\${exec_prefix}/lib/python$PYTHON_VERSION/site-packages"
>  pkgpythondir="\${pythondir}/$me"
>  pkgpyexecdir="\${pyexecdir}/$me"
>  
>  pyvars='PYTHON_VERSION PYTHON_PLATFORM PYTHON_PREFIX PYTHON_EXEC_PREFIX
> -        pythondir pyexecdir pkgpythondir pkgpyexecdir'
> +        pkgpythondir pkgpyexecdir'
>  
>  cat >> configure.in << 'END'
> -AC_CONFIG_FILES([vars-got])
> +AC_CONFIG_FILES([vars-got pythondir pyexecdir])
>  AM_PATH_PYTHON
>  AC_OUTPUT
>  END
> @@ -58,19 +60,30 @@ check-local: test-in test-am
>  .PHONY: test-in test-am
>  
>  test-in:
> +     cat pythondir
> +     case `cat pythondir` in '$${prefix}'/*);; *) exit 1;; esac
> +     cat pyexecdir
> +     case `cat pyexecdir` in '$${exec_prefix}'/*);; *) exit 1;; esac

This is probably pragmatically correct most anywhere, but I don't think
we require pyexecdir to start with ${exec_prefix}.  The user can
override it, for example by a cache variable entry in config.site, no?

Tests should generally be lax wrt. sane config.site entries.  When we
meet insane ones, we may want to decide to disable it for our testsuite,
but let's cross that bridge when we get to it.

>       cat $(srcdir)/vars-exp
>       cat $(builddir)/vars-got
>       diff $(srcdir)/vars-exp $(builddir)/vars-got
> +
> +## Note: this target's rules will be extended in the "for" loop below.
> +test-am:
> +     case '$(pythondir)' in '$(prefix)'/*);; *) exit 1;; esac
> +     case '$(pyexecdir)' in '$(exec_prefix)'/*);; *) exit 1;; esac

Same here.

>  END



reply via email to

[Prev in Thread] Current Thread [Next in Thread]