diff options
Diffstat (limited to 't/color-tests2.sh')
-rw-r--r-- | t/color-tests2.sh | 63 |
1 files changed, 7 insertions, 56 deletions
diff --git a/t/color-tests2.sh b/t/color-tests2.sh index 18fd277e4..f6f0450ee 100644 --- a/t/color-tests2.sh +++ b/t/color-tests2.sh @@ -33,29 +33,6 @@ std="$esc\[m" (set +e; expect -c 'exit 77'; test $? -eq 77) \ || skip_ "requires a working expect program" -# Also, if the $MAKE program fails to consider the standard output as a -# tty (this happens with e.g., BSD make and Solaris dmake when they're -# run in parallel mode; see the autoconf manual), there is little point -# in proceeding. -cat > Makefile <<'END' -all: -## Creative quoting in the 'echo' below to avoid risk of spurious output -## matches by 'expect', below. - @test -t 1 && echo "stdout" "is" "a" "tty" -END - -cat > expect-check <<'END' -eval spawn $env(MAKE) -expect { - "stdout is a tty" { exit 0 } - default { exit 1 } -} -exit 1 -END -MAKE=$MAKE expect -f expect-check \ - || skip_ "make spawned by expect should have a tty stdout" -rm -f expect-check Makefile - # Do the tests. cat >>configure.ac << 'END' @@ -120,36 +97,10 @@ test_color () test_no_color () { - # With make implementations that, like Solaris make, in case of errors - # print the whole failing recipe on standard output, we should content - # ourselves with a laxer check, to avoid false positives. - # Keep this in sync with lib/am/check.am:$(am__color_tests). - if $FGREP '= Xalways; then' stdout; then - # Extra verbose make, resort to laxer checks. - # Note that we also want to check that the testsuite summary is - # not unduly colorized. - ( - set +e # In case some grepped regex below isn't matched. - # Not a useless use of cat; see above comments "grep-nonprinting" - # requirement in 'test-init.sh'. - cat stdout | grep "TOTAL.*:" - cat stdout | grep "PASS.*:" - cat stdout | grep "FAIL.*:" - cat stdout | grep "SKIP.*:" - cat stdout | grep "XFAIL.*:" - cat stdout | grep "XPASS.*:" - cat stdout | grep "ERROR.*:" - cat stdout | grep 'test.*expected' - cat stdout | grep 'test.*not run' - cat stdout | grep '====' - cat stdout | grep '[Ss]ee .*test-suite\.log' - cat stdout | grep '[Tt]estsuite summary' - ) | grep "$esc" && exit 1 - : For shells with broken 'set -e' - else - cat stdout | grep "$esc" && exit 1 - : For shells with broken 'set -e' - fi + # Not a useless use of cat; see above comments "grep-nonprinting" + # requirement in 'test-init.sh'. + cat stdout | grep "$esc" && exit 1 + : } our_make () @@ -160,7 +111,7 @@ our_make () } cat >expect-make <<'END' -eval spawn $env(MAKE) -e check +eval spawn $env(MAKE) check expect eof END @@ -182,7 +133,7 @@ for vpath in false :; do our_make TERM=dumb test_no_color - our_make AM_COLOR_TESTS=no + our_make TERM=ansi MAKE="$MAKE AM_COLOR_TESTS=no" test_no_color $srcdir/configure testsuite_colorized=false @@ -190,7 +141,7 @@ for vpath in false :; do our_make TERM=ansi test_no_color - our_make TERM=ansi MAKE="env AM_COLOR_TESTS=always $MAKE" + our_make TERM=dumb MAKE="$MAKE AM_COLOR_TESTS=always" test_color $MAKE distclean |