]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: hoist envvar-check so it is run for every test
authorJim Meyering <meyering@redhat.com>
Thu, 1 May 2008 21:01:40 +0000 (23:01 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 6 May 2008 06:21:29 +0000 (08:21 +0200)
I.e., also for Perl-based tests; not just the ones using test-lib.sh.
* tests/check.mk (TESTS_ENVIRONMENT): Source envvar-check here, ...
* tests/test-lib.sh: ...not here.

tests/check.mk
tests/du/basic
tests/test-lib.sh

index abe03afcf8c57dd3eb70e7bd3ff62faef07d1cb2..21a82736454c8fbae4dac2adefe070665f9a01e2 100644 (file)
@@ -43,8 +43,11 @@ check: vc_exe_in_TESTS
 built_programs = \
   (cd $(top_builddir)/src && MAKEFLAGS= $(MAKE) -s built_programs.list)
 
-# Append this, because automake does the same.
+# Note that the first line is a statement.  It ensures that environment
+# variables that can perturb tests are unset.  The rest are envvar settings
+# that propagate build-related Makefile variables to test scripts.
 TESTS_ENVIRONMENT =                            \
+  . $(top_srcdir)/tests/envvar-check;          \
   LOCALE_FR='$(LOCALE_FR)'                     \
   abs_top_builddir='$(abs_top_builddir)'       \
   abs_top_srcdir='$(abs_top_srcdir)'           \
index f2eeccf5ba1781189bf3a1556458ffef89638ed1..6833495e48bf10766a1ab2a1a6a2bc918c1d82e0 100755 (executable)
@@ -21,7 +21,6 @@ if test "$VERBOSE" = yes; then
   du --version
 fi
 
-# DU_BLOCK_SIZE could cause problems
 . $top_srcdir/tests/lang-default
 . $top_srcdir/tests/test-lib.sh
 
index 78ac97dd2def7fe2a240cd3553494d82e04de8db..acdcbfb9ca58bfdf23dce5a67fef15d89ea0cea1 100644 (file)
@@ -208,8 +208,6 @@ test_dir_=$(pwd)
 this_test_() { echo "./$0" | sed 's,.*/,,'; }
 this_test=$(this_test_)
 
-. $top_srcdir/tests/envvar-check
-
 # This is a stub function that is run upon trap (upon regular exit and
 # interrupt).  Override it with a per-test function, e.g., to unmount
 # a partition, or to undo any other global state changes.