From 8fb83cd25b587eb71b5dd34da0431b07ae8ef999 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 10 Aug 2010 23:08:03 +0200 Subject: [PATCH] autotest: keep testsuite files on unexpected pass * lib/autotest/general.m4 (AT_INIT) : Don't cleanup the group directory when a test unexpectedly passes. * tests/autotest.at (Cleanup): Check that an unexpected pass leaves the test group directory intact. Signed-off-by: Peter Rosin --- ChangeLog | 8 ++++++++ lib/autotest/general.m4 | 5 +++-- tests/autotest.at | 17 ++++++++++++----- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b892e094..cfa3c0ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-08-10 Peter Rosin + + Keep testsuite files on unexpected pass. + * lib/autotest/general.m4 (AT_INIT) : + Don't cleanup the group directory when a test unexpectedly passes. + * tests/autotest.at (Cleanup): Check that an unexpected pass leaves + the test group directory intact. + 2010-08-10 Ralf Wildenhues Skip AC_FC_SRCEXT([f90]) tests with a Fortran 77 compiler in $FC. diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 170200c9..a2483423 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -1253,8 +1253,9 @@ _ATEOF AS_ECHO(["$at_log_msg"]) >> "$at_group_log" AS_ECHO(["$at_log_msg"]) >&AS_MESSAGE_LOG_FD - # Cleanup the group directory, unless the user wants the files. - if $at_debug_p; then + # Cleanup the group directory, unless the user wants the files + # or the success was unexpected. + if $at_debug_p || test $at_res = xpass; then at_fn_create_debugging_script else if test -d "$at_group_dir"; then diff --git a/tests/autotest.at b/tests/autotest.at index 7c0a7dfd..b617db6d 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -478,6 +478,7 @@ AT_CHECK_AT([Binary output], AT_CHECK_AT_TEST([Cleanup], [AT_CHECK([test ! -f cleanup.success && test ! -f cleanup.failure]) + AT_XFAIL_IF([$xfail]) AT_CHECK_UNQUOTED([exit $value], [ignore], [$output], [], [touch cleanup.failure], [touch cleanup.success])], [], [], [], [], @@ -487,23 +488,29 @@ AT_CHECK_AT_TEST([Cleanup], AT_CHECK([test -f micro-suite.dir/1/cleanup.success]) AT_CHECK([test ! -f micro-suite.dir/1/cleanup.failure]) - AT_CHECK([$CONFIG_SHELL ./micro-suite -d value=1], [], [ignore]) + AT_CHECK([$CONFIG_SHELL ./micro-suite -d xfail=false value=1], [], [ignore]) AT_CHECK([test -f micro-suite.dir/1/cleanup.success]) AT_CHECK([test ! -f micro-suite.dir/1/cleanup.failure]) - AT_CHECK([$CONFIG_SHELL ./micro-suite -d value=1 output=mismatch], + AT_CHECK([$CONFIG_SHELL ./micro-suite xfail=: value=0], + [1], [ignore], [ignore]) + AT_CHECK([test -f micro-suite.dir/1/cleanup.success]) + AT_CHECK([test ! -f micro-suite.dir/1/cleanup.failure]) + + AT_CHECK([$CONFIG_SHELL ./micro-suite -d xfail=false value=1 output=mismatch], [1], [ignore], [ignore]) AT_CHECK([test ! -f micro-suite.dir/1/cleanup.success]) AT_CHECK([test -f micro-suite.dir/1/cleanup.failure]) - AT_CHECK([$CONFIG_SHELL ./micro-suite -d value=77], [], [ignore]) + AT_CHECK([$CONFIG_SHELL ./micro-suite -d xfail=false value=77], [], [ignore]) AT_CHECK([test ! -f micro-suite.dir/1/cleanup.success]) AT_CHECK([test ! -f micro-suite.dir/1/cleanup.failure]) - AT_CHECK([$CONFIG_SHELL ./micro-suite -d value=99], [1], [ignore], [ignore]) + AT_CHECK([$CONFIG_SHELL ./micro-suite -d xfail=false value=99], + [1], [ignore], [ignore]) AT_CHECK([test ! -f micro-suite.dir/1/cleanup.success]) AT_CHECK([test ! -f micro-suite.dir/1/cleanup.failure]) - ], [-d value=0]) + ], [-d xfail=false value=0]) ## ----------------------------------------------------- ## ## Newlines and command substitutions in test commands. ##