[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 09/32] tests: update PATH early from AM_TESTS_ENVIRONMENT and
From: |
Stefano Lattarini |
Subject: |
Re: [PATCH 09/32] tests: update PATH early from AM_TESTS_ENVIRONMENT and runtest |
Date: |
Thu, 26 Jul 2012 14:09:53 +0200 |
On 07/26/2012 02:04 PM, Stefano Lattarini wrote:
> Because the POSIX standards mandate that sourcing a file with ". FILE"
> will cause FILE (assuming it is a relative containing no slashes) to be
> looked for in PATH, such a move will allow us to simplify our sourcing
> of shell testing libraries like (currently) 't/ax/test-init.sh' and
> 'defs', and to modularize and re-organize them better in the feature,
> with minimal churn.
>
> * runtest.in, Makefile.am (AM_TEST_ENVIRONMENT): Prepend $(abs_srcdir)/t/ax
> and $(abs_builddir)/t/ax (in that order) to PATH; do so avoiding repetition
> in the common case of non-VPATH builds.
>
> Signed-off-by: Stefano Lattarini <address@hidden>
> ---
> Makefile.am | 10 ++++++++++
> runtest.in | 12 ++++++++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/Makefile.am b/Makefile.am
> index 6b6e938..1636623 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -350,6 +350,16 @@ AM_TESTS_ENVIRONMENT = \
> AM_TESTS_FD_REDIRECT = 9>&2
> AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
>
> +# For sourcing of extra "shell libraries" by our test scripts. As per
> +# POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
> +# in case it is given with a relative name containing no slashes.
> +AM_TESTS_ENVIRONMENT += \
> + if test "$srcdir" != .; then \
>
Oops, typo here. Consider this hunk squashed in:
diff --git a/Makefile.am b/Makefile.am
index 1636623..ecd0baa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -354,7 +354,7 @@ AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export
stderr_fileno_;
# POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
# in case it is given with a relative name containing no slashes.
AM_TESTS_ENVIRONMENT += \
- if test "$srcdir" != .; then \
+ if test $(srcdir) != .; then \
PATH='$(abs_srcdir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
fi; \
PATH='$(abs_builddir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
> + PATH='$(abs_srcdir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
> + fi; \
> + PATH='$(abs_builddir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
> + export PATH;
> +
> # Hand-written tests.
>
Thanks,
Stefano
- [PATCH 00/32] {maint} Several testsuite refactorings, Stefano Lattarini, 2012/07/26
- [PATCH 01/32] cosmetics: remove leftover comment fragment from runtest.in, Stefano Lattarini, 2012/07/26
- [PATCH 05/32] build: auxiliary testsuite files/scripts built by "make all", Stefano Lattarini, 2012/07/26
- [PATCH 03/32] runtest: pass *all* the given shell options to the test invocation, Stefano Lattarini, 2012/07/26
- [PATCH 07/32] gen-tests: $testdir/ax -> $testauxdir, Stefano Lattarini, 2012/07/26
- [PATCH 02/32] runtest: correctly pass shell option also for TAP tests, Stefano Lattarini, 2012/07/26
- [PATCH 04/32] perf tests: reorganize, Stefano Lattarini, 2012/07/26
- [PATCH 09/32] tests: update PATH early from AM_TESTS_ENVIRONMENT and runtest, Stefano Lattarini, 2012/07/26
- Re: [PATCH 09/32] tests: update PATH early from AM_TESTS_ENVIRONMENT and runtest,
Stefano Lattarini <=
- [PATCH 06/32] gen-tests: less hard-coding of 't' as the test directory, Stefano Lattarini, 2012/07/26
- [PATCH 10/32] test defs: move in 't/ax/test-defs.sh', Stefano Lattarini, 2012/07/26
- [PATCH 08/32] runtest: export $srcdir for use by the test scripts, Stefano Lattarini, 2012/07/26
- [PATCH 12/32] test init: remove a couple of paranoid sanity checks, Stefano Lattarini, 2012/07/26
- [PATCH 15/32] test init: refactor: new function 'am_exit_trap', Stefano Lattarini, 2012/07/26
- [PATCH 14/32] test init: refactor: new function 'process_requirements', Stefano Lattarini, 2012/07/26
- [PATCH 18/32] test init: refactor: new function 'am_setup_testdir', Stefano Lattarini, 2012/07/26
- [PATCH 13/32] test init: refactor: new function 'require_tool', Stefano Lattarini, 2012/07/26
- [PATCH 17/32] test init: refactor: new function 'am_set_exit_traps', Stefano Lattarini, 2012/07/26
- [PATCH 11/32] tests: simplify sourcing of helper shell files, Stefano Lattarini, 2012/07/26