tests: save and restore TERM around use of TESTS_ENVIRONMENT,
authorJim Meyering <meyering@redhat.com>
Sun, 4 May 2008 10:23:28 +0000 (12:23 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 6 May 2008 06:21:30 +0000 (08:21 +0200)
now that TESTS_ENVIRONMENT unsets it.
* check.mk (am__check_pre): Save $TERM.
(am__check_post): Restore saved value of TERM and export.

build-aux/check.mk

index 9d909c6..9cd1b33 100644 (file)
@@ -100,6 +100,8 @@ _dirname = \
 # To be inserted before the command running the test.  Creates the
 # directory for the log if needed.  Stores in $dir the directory
 # containing $src, and passes TESTS_ENVIRONMENT.
+# Save and restore TERM around use of TESTS_ENVIRONMENT,
+# in case that unsets it.
 am__check_pre =                                        \
 $(SH_E_WORKAROUND);                            \
 tst=`echo "$$src" | sed 's|^.*/||'`;           \
@@ -110,6 +112,7 @@ $(mkdir_p) "$$(echo '$@'|$(_dirname))" || exit;     \
 if test -f "./$$src"; then dir=./;             \
 elif test -f "$$src"; then dir=;               \
 else dir="$(srcdir)/"; fi;                     \
+__SAVED_TERM=$$TERM;                           \
 $(TESTS_ENVIRONMENT) $(SHELL)
 
 # To be appended to the command running the test.  Handles the stdout
@@ -120,6 +123,7 @@ estatus=$$?;                                                \
 if test $$estatus -eq 177; then                                \
   $(ENABLE_HARD_ERRORS) || estatus=1;                  \
 fi;                                                    \
+TERM=$$__SAVED_TERM; export TERM;                      \
 $(am__tty_colors);                                     \
 xfailed=PASS;                                          \
 for xfail in : $(XFAIL_TESTS); do                      \