# # # delete "tests/syntax_errors_in_.mtn-ignore/stderr-ref" # # delete "tests/syntax_errors_in_.mtn-ignore/stdout-ref" # # patch "contrib/dump-test-logs.sh" # from [ccc00999e139b734e54f498e7e32900465811ab4] # to [4704860e558cd008279f58ba7ccd11b2a0789895] # # patch "debian/changelog" # from [f4383665041ab3263c55b3b96b1c60c652ac8c77] # to [43b600ea4385405176d1cc248de1cb81605aa514] # # patch "tests/syntax_errors_in_.mtn-ignore/__driver__.lua" # from [bde70689c213e47218c54770848fe41f4de21916] # to [060eeb7ac3ad75389da65bf09a3f4e38fff62440] # # patch "tests/syntax_errors_in_.mtn-ignore/mtn-ignore" # from [3735136dc7e7c64509de51bfb76dbd141d2ae971] # to [c46ecd3b4771b7b0af41b6caff2074df0427fbfa] # ============================================================ --- contrib/dump-test-logs.sh ccc00999e139b734e54f498e7e32900465811ab4 +++ contrib/dump-test-logs.sh 4704860e558cd008279f58ba7ccd11b2a0789895 @@ -9,11 +9,12 @@ # Conveniently enough, testlib.lua does most of the work for us. -dumped=0 for log in tester_dir/*.log do - if grep "^\*\**$" < $log > /dev/null 2>&1; then - dumped=1 + if grep "0 failed" < $log > /dev/null 2>&1 && + grep "0 succeeded unexpectedly" < $log > /dev/null 2>&1 + then : + else echo echo "### $log ###" echo @@ -21,10 +22,12 @@ done fi done -# Exit unsuccessfully if we dumped anything, so that a driver Makefile +# Always exit unsuccessfully, so that a driver Makefile # can do something like # # make check || sh dump-test-logs.sh # # and have that fail the build just like plain "make check" would. +# (The above should dump something if and only if the preceding "make +# check" failed, but that has been unreliable in the past.) +exit 1 -exit $dumped ============================================================ --- debian/changelog f4383665041ab3263c55b3b96b1c60c652ac8c77 +++ debian/changelog 43b600ea4385405176d1cc248de1cb81605aa514 @@ -1,3 +1,12 @@ +monotone (0.40-6) unstable; urgency=low + + * dump-test-logs.sh: always exit unsuccessfully, to prevent masking an + unsuccessful test run. + * syntax_errors_in_.mtn-ignore test: eliminate fragile dependency on + details of error messages / order of output. + + -- Zack Weinberg Thu, 24 Jul 2008 15:00:35 -0700 + monotone (0.40-5) unstable; urgency=low * Backport from upstream development tree: ============================================================ --- tests/syntax_errors_in_.mtn-ignore/__driver__.lua bde70689c213e47218c54770848fe41f4de21916 +++ tests/syntax_errors_in_.mtn-ignore/__driver__.lua 060eeb7ac3ad75389da65bf09a3f4e38fff62440 @@ -1,18 +1,34 @@ -- In this test, we put things in .mtn-ignore that trigger every -- possible syntax error message from the regular expression library, -- to ensure that the user's view of these errors is sensible. +-- +-- It is just too error prone to try to grep for actual error message +-- texts, so instead we check for functionality (despite the syntax +-- errors, "ignoreme" and "ignoremetoo" should be ignored, +-- "dontignoreme" not) and for the presence of at least *some* error +-- messages on stderr. mtn_setup() writefile("ignoreme") +writefile("ignoremetoo") writefile("dontignoreme") check(get("mtn-ignore", ".mtn-ignore")) check(raw_mtn("ls", "unknown"), 0, true, true) -canonicalize("stdout") -check(get("stdout-ref")) -check(get("stderr-ref")) +check(qgrep("^dontignoreme$", "stdout")) +check(not qgrep("^ignoreme$", "stdout")) +check(not qgrep("^ignoremetoo$", "stdout")) + +check(qgrep("error near char", "stderr")) +check(qgrep("skipping this regex", "stderr")) + +check(raw_mtn("ls", "ignored"), 0, true, true) + +check(not qgrep("^dontignoreme$", "stdout")) +check(qgrep("^ignoreme$", "stdout")) +check(qgrep("^ignoremetoo$", "stdout")) + +check(qgrep("error near char", "stderr")) +check(qgrep("skipping this regex", "stderr")) -check(samefile("stdout", "stdout-ref")) --- the first line of stderr may vary from run to run -check(tailfile("stderr", 1) == readfile("stderr-ref")) ============================================================ --- tests/syntax_errors_in_.mtn-ignore/mtn-ignore 3735136dc7e7c64509de51bfb76dbd141d2ae971 +++ tests/syntax_errors_in_.mtn-ignore/mtn-ignore c46ecd3b4771b7b0af41b6caff2074df0427fbfa @@ -1,3 +1,4 @@ +^ignoreme$ \ \c x{3,1} @@ -29,4 +30,4 @@ abc\3 (?P<*>x) (?P) \777 +^ignoremetoo$ -^ignoreme$