tests: fixup: make distcheck-override-infodir pass again
[platform/upstream/automake.git] / runtest.in
index c818840..f5068e8 100644 (file)
@@ -40,6 +40,23 @@ export PATH
 # define this, so we better do the same.
 export srcdir
 
+# Some testsuite-influential variables should be overridable from the
+# test scripts, but not from the environment.
+# Keep this in sync with the 'Makefile.am:AM_TESTS_ENVIRONMENT'.
+for v in \
+  required \
+  am_test_protocol \
+  am_serial_tests \
+  am_test_prefer_config_shell \
+  am_original_AUTOMAKE \
+  am_original_ACLOCAL \
+  am_test_lib_sourced \
+  test_lib_sourced \
+; do
+  eval "$v= && unset $v" || exit 1
+done
+unset v
+
 error () { echo "$0: $*" >&2; exit 255; }
 
 # Some shell flags should be passed over to the test scripts.
@@ -91,10 +108,10 @@ esac
 
 case $tst in
   *.sh)
-    exec $AM_TEST_RUNNER_SHELL $shell_opts "$tst" "$@" ;;
+    exec $AM_TEST_RUNNER_SHELL $shell_opts "$tst" ${1+"$@"} ;;
   *.tap)
     exec "$AM_PROVE_CMD" $AM_PROVEFLAGS -e \
-         "$AM_TEST_RUNNER_SHELL $shell_opts" "$tst" "$@" ;;
+         "$AM_TEST_RUNNER_SHELL $shell_opts" "$tst" ${1+"$@"} ;;
   *)
     error "test '$tst' has an unrecognized extension" ;;
 esac