From ecbceb3e4cb88019e490c4814ca7a7382e4e2299 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 25 Jul 2012 18:14:23 +0200 Subject: [PATCH] test defs: move in 't/ax/test-defs.sh' We can do so with minimal churn, now that the early setup of $PATH in both 'runtest' and AM_TESTS_ENVIRONMENT allow the '.' built-in to find to-be-sourced shell scripts in 't/ax' automatically, both in in-tree and VPATH builds. With this change, we take another step forward a more rational and "segregated" organization of our testsuite framework. * defs-static.in: Rename ... * t/ax/test-defs.in: ... like this, and adjust. * Makefile.am, syntax-checks.mk, t/README, gen-testsuite-part, t/tests-init.sh, t/ax/tap-setup.sh, t/tap-summary.sh, .gitignore, t/testsuite-summary-color.sh, t/testsuite-summary-count.sh, t/self-check-tap.sh, defs: Adjust. Signed-off-by: Stefano Lattarini --- .gitignore | 2 +- Makefile.am | 12 ++++++------ defs | 2 +- gen-testsuite-part | 2 +- syntax-checks.mk | 5 ++++- t/README | 2 +- t/ax/tap-setup.sh | 2 +- defs-static.in => t/ax/test-defs.in | 6 ++++-- t/ax/test-init.sh | 8 ++++---- t/self-check-tap.sh | 26 +++++++++++++------------- t/tap-summary-color.sh | 2 +- t/tap-summary.sh | 2 +- t/testsuite-summary-color.sh | 2 +- t/testsuite-summary-count.sh | 2 +- 14 files changed, 40 insertions(+), 35 deletions(-) rename defs-static.in => t/ax/test-defs.in (97%) diff --git a/.gitignore b/.gitignore index b7eee5c..c3e83f9 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,7 @@ /test-suite.log /t/wrap/aclocal-1.* /t/wrap/automake-1.* -/defs-static +/t/ax/test-defs.sh /t/testsuite-part.am /t/*-w.tap /t/*-w.sh diff --git a/Makefile.am b/Makefile.am index ecd0baa..eae7309 100644 --- a/Makefile.am +++ b/Makefile.am @@ -408,14 +408,14 @@ t/distcheck-missing-m4.log: t/ax/distcheck-hook-m4.am t/distcheck-outdated-m4.log: t/ax/distcheck-hook-m4.am EXTRA_DIST += t/ax/distcheck-hook-m4.am -defs-static: defs-static.in Makefile +t/ax/test-defs.sh: t/ax/test-defs.in Makefile $(AM_V_at)rm -f $@ $@-t - $(AM_V_GEN)in=defs-static.in\ - && $(do_subst) <$(srcdir)/defs-static.in >$@-t + $(AM_V_GEN)in=t/ax/test-defs.in \ + && $(do_subst) <$(srcdir)/$$in >$@-t $(generated_file_finalize) -EXTRA_DIST += defs-static.in -CLEANFILES += defs-static -nodist_noinst_DATA = defs-static +EXTRA_DIST += t/ax/test-defs.in +CLEANFILES += t/ax/test-defs.sh +nodist_noinst_DATA = t/ax/test-defs.sh runtest: runtest.in Makefile $(AM_V_at)rm -f $@ $@-t diff --git a/defs b/defs index df85746..f69b780 100644 --- a/defs +++ b/defs @@ -16,7 +16,7 @@ # along with this program. If not, see . # Source the shell static setup and variable definitions. -. ./defs-static; test $? -eq 0 || exit 99 +. test-defs.sh; test $? -eq 0 || exit 99 # Source the actual test initialization and setup code, and return # control to the test script that is sourcing us. diff --git a/gen-testsuite-part b/gen-testsuite-part index 2e79057..d646b27 100755 --- a/gen-testsuite-part +++ b/gen-testsuite-part @@ -96,7 +96,7 @@ sub write_wrapper_script ($$$) print $file_handle unindent <&2 exit 99 } # Ensure $am_top_builddir is set correctly. -test -f "$am_top_builddir/defs-static" || { - echo "$me: $am_top_builddir/defs-static not found," \ +test -f "$am_top_builddir/automake" || { + echo "$me: $am_top_builddir/automake not found," \ "check \$am_top_builddir" >&2 exit 99 } diff --git a/t/self-check-tap.sh b/t/self-check-tap.sh index d7f788c..8d84621 100755 --- a/t/self-check-tap.sh +++ b/t/self-check-tap.sh @@ -15,31 +15,31 @@ # along with this program. If not, see . # Sanity check for the automake testsuite. -# Make sure that $am_using_tap gets automatically defined by -# './defs-static', but can be overridden by the individual tests. +# Make sure that '$am_using_tap' gets automatically defined by +# 'test-defs.sh', but can be overridden by the individual tests. -. ./defs-static || exit 1 +. test-defs.sh set -ex $AM_TEST_RUNNER_SHELL -c \ - '. ./defs-static && test $am_using_tap = yes' foo.tap + ". test-defs.sh && test \$am_using_tap = yes" foo.tap for name in foo.test tap tap.test foo-tap; do $AM_TEST_RUNNER_SHELL -c \ - '. ./defs-static && test $am_using_tap = no' $name + ". test-defs.sh && test \$am_using_tap = no" $name done -$AM_TEST_RUNNER_SHELL -c ' +$AM_TEST_RUNNER_SHELL -c " am_using_tap=no - . ./defs-static - test $am_using_tap = no -' foo.tap + . test-defs.sh + test \$am_using_tap = no +" foo.tap -$AM_TEST_RUNNER_SHELL -c ' +$AM_TEST_RUNNER_SHELL -c " am_using_tap=yes - . ./defs-static - test $am_using_tap = yes -' foo.test + . test-defs.sh + test \$am_using_tap = yes +" foo.test : diff --git a/t/tap-summary-color.sh b/t/tap-summary-color.sh index a28512b..8f533b4 100755 --- a/t/tap-summary-color.sh +++ b/t/tap-summary-color.sh @@ -17,7 +17,7 @@ # TAP support: # - colorized testsuite summary -. ./defs-static +. test-defs.sh use_colors=yes . "$am_testauxdir"/tap-summary-aux.sh diff --git a/t/tap-summary.sh b/t/tap-summary.sh index deee099..846239c 100755 --- a/t/tap-summary.sh +++ b/t/tap-summary.sh @@ -17,7 +17,7 @@ # TAP support: # - colorized testsuite summary -. ./defs-static +. test-defs.sh use_colors=no . "$am_testauxdir"/tap-summary-aux.sh diff --git a/t/testsuite-summary-color.sh b/t/testsuite-summary-color.sh index c73ca45..e1a7471 100755 --- a/t/testsuite-summary-color.sh +++ b/t/testsuite-summary-color.sh @@ -16,7 +16,7 @@ # Check coloring of the testsuite summary. -. ./defs-static || exit 1 +. test-defs.sh use_colors=yes use_vpath=no diff --git a/t/testsuite-summary-count.sh b/t/testsuite-summary-count.sh index 265eebf..a6e5462 100755 --- a/t/testsuite-summary-count.sh +++ b/t/testsuite-summary-count.sh @@ -16,7 +16,7 @@ # Check test counts in the testsuite summary. -. ./defs-static || exit 1 +. test-defs.sh use_colors=no use_vpath=no -- 2.7.4