From: Ralf Wildenhues Date: Mon, 14 Apr 2008 21:10:01 +0000 (+0200) Subject: New tests: errexit, input from stdin. X-Git-Tag: v2.63~96 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1cd13960d1ec9a23364d0b3d1b50438b0c537db;p=thirdparty%2Fautoconf.git New tests: errexit, input from stdin. * tests/autotest.at (AT_CHECK_AT): Allow to pass additional arguments to the inner suite. (errexit, input from stdin): New tests. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index cb9bbda53..b1d9a4e1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-14 Ralf Wildenhues + + * tests/autotest.at (AT_CHECK_AT): Allow to pass additional + arguments to the inner suite. + (errexit, input from stdin): New tests. + 2008-04-13 Ralf Wildenhues * NEWS: Post-release update. diff --git a/tests/autotest.at b/tests/autotest.at index 1f5ce0bc7..e6dc86242 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -52,21 +52,22 @@ m4_popdef([AT_dir])dnl ]) # AT_CHECK_AT_PREP # AT_CHECK_AT(TITLE, SUITE-CODE, [XFAIL-CONDITION], [STATUS = 0], -# [STDOUT := ignore], STDERR, [POST-TEST-CODE]) -# --------------------------------------------------------------- +# [STDOUT = ignore], STDERR, [POST-TEST-CODE], [SUITE-ARGS]) +# ---------------------------------------------------------------------- # Create a new test named TITLE that runs a minimal Autotest test suite, -# SUITE-CODE. Call AT_XFAIL_IF with XFAIL-CONDITION. STATUS and STDERR pass -# directly to the AT_CHECK that call the minimal test suite. STDOUT is not -# used, but it is reserved for future use. Run POST-TEST-CODE -# at the top level after the micro-suite has been run. +# SUITE-CODE with additional SUITE-ARGS, once without and once with +# '-v -x' added. Call AT_XFAIL_IF with XFAIL-CONDITION. Pass STDERR +# directly to the AT_CHECK that calls the minimal test suite, STDOUT to +# the AT_CHECK without '-v -x'; ignore stdout for the latter. +# Run POST-TEST-CODE at the top level after the micro-suite has been run. m4_define([AT_CHECK_AT], [AT_SETUP([$1]) AT_XFAIL_IF([$3]) AT_CHECK_AT_PREP([micro-suite], [$2]) -AT_CHECK([$CONFIG_SHELL ./micro-suite], m4_default([$4], 0), - [ignore], [$6]) -AT_CHECK([$CONFIG_SHELL ./micro-suite -v -x], m4_default([$4], 0), +AT_CHECK([$CONFIG_SHELL ./micro-suite $8], m4_default([$4], 0), + m4_default([$5], [ignore]), [$6]) +AT_CHECK([$CONFIG_SHELL ./micro-suite -v -x $8], m4_default([$4], 0), [ignore], [$6]) $7 AT_CLEANUP @@ -232,6 +233,18 @@ AT_CHECK_AT_TEST([Skip], [], [], [], [], [AT_CHECK([grep skipped micro-suite.log], [], [ignore])]) +AT_CHECK_AT_TEST([errexit], + [AT_CHECK([false]) + AT_CLEANUP + AT_SETUP([test that should not be run]) + AT_CHECK([:])], + [], [1], [stdout], [stderr], + [AT_CHECK([test -f micro-suite.log], [1]) + touch micro-suite.log # shut up AT_CAPTURE_FILE. + AT_CHECK([grep "should not be run" stdout], [1]) + AT_CHECK([grep "1 .* inhibited subsequent" stderr], [], [ignore])], + [--errexit]) + AT_CHECK_AT_TEST([Literal multiline command], [AT_CHECK([echo Auto' 'conf], 0, [Auto @@ -362,6 +375,26 @@ conf ], [])]) +## ----------------- ## +## Input from stdin. ## +## ----------------- ## + +AT_SETUP([Input from stdin]) + +AT_CHECK_AT_PREP([micro-suite], +[[AT_INIT +AT_SETUP([please enter hello]) +AT_CHECK([cat], [], [hello +]) +AT_CLEANUP +]]) + +AT_CHECK([echo hello | $CONFIG_SHELL ./micro-suite], [], [ignore]) +AT_CHECK([$CONFIG_SHELL ./micro-suite