[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: avoid possibly undeserved PASS from check8.test

From: Peter Rosin
Subject: [PATCH] tests: avoid possibly undeserved PASS from check8.test
Date: Fri, 27 Jan 2012 10:32:47 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1


Due to some confusion, I happened to look at check8.log from a successful
run when I thought it had failed.  Anyway, I noticed a weakness in this
output, quoting from the end of check8.log:

make  check-TESTS
make[1]: Entering directory `/home/peda/automake/tests/check8.dir/build'
XPASS: foo
PASS: sub/foo
PASS: bar.exe
PASS: sub/bar.exe
FAIL: baz.exe
XFAIL: sub/baz.exe
2 of 6 tests did not behave as expected (1 unexpected pass)
make[1]: Leaving directory `/home/peda/automake/tests/check8.dir/build'
+ grep 'XPASS.*foo$' stdout
XPASS: foo
+ grep '^[^X]*PASS.*sub/foo$' stdout
PASS: sub/foo
+ grep '^[^X]*PASS.*bar' stdout
PASS: bar.exe
PASS: sub/bar.exe
+ grep '^[^X]*PASS.*sub/bar' stdout
PASS: sub/bar.exe
+ grep '^[^X]*FAIL.*baz' stdout
FAIL: baz.exe
+ grep 'XFAIL.*sub/baz' stdout
XFAIL: sub/baz.exe
+ :
+ exit_status=0
+ set +e
+ cd /home/peda/automake/tests
+ case $exit_status,$keep_testdirs in
+ find check8.dir -type d '!' -perm -700 -exec chmod u+rwx '{}' ';'
+ rm -rf check8.dir
+ test 0 '!=' 0
+ echo 'check8: exit 0'
check8: exit 0
+ exit 0

See how "grep '^[^X]*PASS.*bar' stdout" finds two matching lines?

Here's a fix, ok for maint?

Or is it just too bleeding unlikely that things will fail here
when they passed muster in the colorized check done a few lines
up in check8.test?


>From edaca55fc2bb826fc28e37f382db06496f3abf5e Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Fri, 27 Jan 2012 10:28:25 +0100
Subject: [PATCH] tests: avoid possibly undeserved PASS from check8.test

* tests/check8.test: Adjust grep pattern to not match "sub/bar"
when looking for "bar" during the uncolorized tests.
 tests/check8.test |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/check8.test b/tests/check8.test
index dc8d3dd..327b837 100755
--- a/tests/check8.test
+++ b/tests/check8.test
@@ -91,7 +91,7 @@ cat stdout
 # rewriting (if we fix that, we can still write a separate test for it).
 grep 'XPASS.*foo$' stdout
 grep '^[^X]*PASS.*sub/foo$' stdout
-grep '^[^X]*PASS.*bar' stdout
+grep '^[^X]*PASS.*[^b][^/]bar' stdout
 grep '^[^X]*PASS.*sub/bar' stdout
 grep '^[^X]*FAIL.*baz' stdout
 grep 'XFAIL.*sub/baz' stdout

reply via email to

[Prev in Thread] Current Thread [Next in Thread]