]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
test defs: move in 't/ax/test-defs.sh'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 25 Jul 2012 16:14:23 +0000 (18:14 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jul 2012 12:11:33 +0000 (14:11 +0200)
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 <stefano.lattarini@gmail.com>
14 files changed:
.gitignore
Makefile.am
defs
gen-testsuite-part
syntax-checks.mk
t/README
t/ax/tap-setup.sh
t/ax/test-defs.in [moved from defs-static.in with 97% similarity]
t/ax/test-init.sh
t/self-check-tap.sh
t/tap-summary-color.sh
t/tap-summary.sh
t/testsuite-summary-color.sh
t/testsuite-summary-count.sh

index b7eee5c4fc9d199fa7e5fe767dc93a4a3311ee26..c3e83f998e496ad86b89782ea8c134922e212605 100644 (file)
@@ -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
index ecd0baaeaf18b6fef77517659a7fa6dfcd439fe4..eae7309e7dac89e833f873ad96f78d9603915264 100644 (file)
@@ -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 df85746b0ea54a10052f785986d4dffb0459dbb5..f69b7800cbb0de5dce08778522cadb6bded1e404 100644 (file)
--- a/defs
+++ b/defs
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # 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.
index 2e79057940fb0c4efbb1874c23ab97eab64147fa..d646b27690c427c960ef20f44e2771d2058c8d3a 100755 (executable)
@@ -96,7 +96,7 @@ sub write_wrapper_script ($$$)
   print $file_handle unindent <<EOF;
     #! /bin/sh
     # This file has been automatically generated.  DO NOT EDIT BY HAND!
-    . ./defs-static || exit 1
+    . test-defs.sh
     $shell_setup_code
     # In the spirit of VPATH, we prefer a test in the build tree
     # over one in the source tree.
index 3b209115c8bd1138e733e340560dee8c6f875b86..bcaf50f34292cc7705ea496fdf54b29cca0366a3 100644 (file)
@@ -31,7 +31,10 @@ xtests := $(shell \
      done; \
    done | sort)
 
-xdefs = $(srcdir)/t/ax/test-init.sh $(srcdir)/defs $(srcdir)/defs-static.in
+xdefs = \
+  $(srcdir)/t/ax/test-init.sh \
+  $(srcdir)/t/ax/test-defs.in \
+  $(srcdir)/defs
 
 ams := $(shell find $(srcdir) -name '*.dir' -prune -o -name '*.am' -print)
 
index 60b4252799bad01e7e67c14e5cd622c2161c4385..06f087f77bb4717e3da33f60289d40d9e2e43405 100644 (file)
--- a/t/README
+++ b/t/README
@@ -234,7 +234,7 @@ Writing test cases
   example, if you need to copy or grep an automake-provided script,
   do not assume that they can be found in the '$top_srcdir/lib'
   directory, but use '$am_scriptdir' instead.  The complete list of
-  such "$am_...dir" variables can be found in the 'defs-static.in'
+  such "$am_...dir" variables can be found in the 't/ax/test-defs.in'
   file.
 
 * When writing input for lex, include the following in the definitions
index 70487c3e5ca07a828fc3c0aaa7098dac0f8c4bd2..952a49dfa3047fff98fd9d11fe32793e28fd5b73 100644 (file)
@@ -22,7 +22,7 @@
 
 # Check that we are running from a proper directory: last thing we want
 # is to overwrite some random user files.
-test -f ../../defs-static && test -f ../../defs && test -d ../../t \
+test -f ../../automake && test -f ../../defs && test -d ../../t \
   || fatal_ "running from a wrong directory"
 
 test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
similarity index 97%
rename from defs-static.in
rename to t/ax/test-defs.in
index bb7ca494d8f3731adab95c9a9e9c67948ea46ba3..c5b0a548340590c23b95b669372e85f7612762cf 100644 (file)
@@ -160,8 +160,8 @@ AUTOUPDATE=${AM_TESTSUITE_AUTOUPDATE-${AUTOUPDATE-'@am_AUTOUPDATE@'}}
 
 # Tests who want complete control over aclocal or automake command-line
 # options should use $am_original_ACLOCAL or $am_original_AUTOMAKE.  The
-# "test -z" tests take care not to re-initialize them if defs-static
-# is re-sourced, as we want defs-static to remain really idempotent.
+# "test -z" tests take care not to re-initialize them if 'test-defs.sh'
+# is re-sourced, as we want that file to remain really idempotent.
 if test -z "$am_original_AUTOMAKE"; then
   am_original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}}
 fi
@@ -239,6 +239,8 @@ case $PATH in
 esac
 
 # Make our helper script accessible by default.
+# The '$am_testauxdir' should be defined in the environment of
+# our testsuite.
 PATH=$am_testauxdir$PATH_SEPARATOR$PATH
 
 export PATH
index a1130e35569bf03c156f8182cdd1d78b79301860..5376b4700517d5bd3075bd107605ea190bcfcc1b 100644 (file)
@@ -28,15 +28,15 @@ set -e
 ## --------------------- ##
 
 # Ensure $am_top_srcdir is set correctly.
-test -f "$am_top_srcdir/defs-static.in" || {
-   echo "$me: $am_top_srcdir/defs-static.in not found," \
+test -f "$am_top_srcdir/automake.in" || {
+   echo "$me: $am_top_srcdir/automake.in not found," \
         "check \$am_top_srcdir" >&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
 }
index d7f788c6b8f13c49a916f49e7309279c5f13e483..8d846213fa8dc022b8ddc8b9649e439c576da2a2 100755 (executable)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # 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
 
 :
index a28512b69f5d77fa0a6878414ce474fbff89cb65..8f533b4d1e585d51fde1324a820959c82eefb267 100755 (executable)
@@ -17,7 +17,7 @@
 # TAP support:
 #  - colorized testsuite summary
 
-. ./defs-static
+. test-defs.sh
 
 use_colors=yes
 . "$am_testauxdir"/tap-summary-aux.sh
index deee0998427941e06fea16bbe2a0b33ed228df92..846239cfe19023ca206456a6e61de05dad41ebb0 100755 (executable)
@@ -17,7 +17,7 @@
 # TAP support:
 #  - colorized testsuite summary
 
-. ./defs-static
+. test-defs.sh
 
 use_colors=no
 . "$am_testauxdir"/tap-summary-aux.sh
index c73ca45f8a353529eded7f7fdf7abe7132114558..e1a74715468ed94b3b0488d6b318c405e19d4837 100755 (executable)
@@ -16,7 +16,7 @@
 
 # Check coloring of the testsuite summary.
 
-. ./defs-static || exit 1
+. test-defs.sh
 
 use_colors=yes
 use_vpath=no
index 265eebfa460c722646e80119a72a2acd3e4f8252..a6e546299e0d013b16157758c5cccd50dfba9251 100755 (executable)
@@ -16,7 +16,7 @@
 
 # Check test counts in the testsuite summary.
 
-. ./defs-static || exit 1
+. test-defs.sh
 
 use_colors=no
 use_vpath=no