]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
New tests: errexit, input from stdin.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 14 Apr 2008 21:10:01 +0000 (23:10 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 14 Apr 2008 21:10:01 +0000 (23:10 +0200)
* 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 <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/autotest.at

index cb9bbda53a26d92cd437ea333638acfa972f55bb..b1d9a4e1ab82c39d52b6db52488edac060ed6601 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * 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  <Ralf.Wildenhues@gmx.de>
 
        * NEWS: Post-release update.
index 1f5ce0bc709bd4010426387ece4d170fd807cef6..e6dc862421c236436cec7e6a8cb98c91075d884f 100644 (file)
@@ -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<RETURN><EOF>])
+AT_CHECK([cat], [], [hello
+])
+AT_CLEANUP
+]])
+
+AT_CHECK([echo hello | $CONFIG_SHELL ./micro-suite], [], [ignore])
+AT_CHECK([$CONFIG_SHELL ./micro-suite </dev/null], [1], [ignore], [ignore])
+
+AT_CLEANUP
+
+
 ## ------------------------------- ##
 ## Funny characters in test names. ##
 ## ------------------------------- ##