]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Hard fail any test with syntax errors.
authorEric Blake <ebb9@byu.net>
Mon, 6 Apr 2009 16:40:49 +0000 (10:40 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 7 Apr 2009 02:52:41 +0000 (20:52 -0600)
* lib/autotest/general.m4 (AT_INIT) <at_fn_group_postprocess>:
Guarantee test failure on syntax error, rather than inheriting
status from previous test.
* tests/autotest.at (Syntax error): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/autotest/general.m4
tests/autotest.at

index f0f9296d2f24140b9556a0ebb6930150f548b856..fba76adf6e6b5a896ac1fbb7eb81d6c49347fe10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-06  Eric Blake  <ebb9@byu.net>
+
+       Hard fail any test with syntax errors.
+       * lib/autotest/general.m4 (AT_INIT) <at_fn_group_postprocess>:
+       Guarantee test failure on syntax error, rather than inheriting
+       status from previous test.
+       * tests/autotest.at (Syntax error): New test.
+
 2009-03-31  Eric Blake  <ebb9@byu.net>
 
        Beta Release Version 2.63b.
index 86a5c6aa2bbd7bd13123a06fb320ffc69b12ac0e..77058544af63117002c74fb1cffd95f77b6a204c 100644 (file)
@@ -1130,6 +1130,7 @@ at_fn_group_postprocess ()
       report this failure to <AT_PACKAGE_BUGREPORT>.
 _ATEOF
     AS_ECHO(["$at_setup_line"]) >"$at_check_line_file"
+    at_xfail=no at_status=99
   fi
   $at_verbose AS_ECHO_N(["$at_group. $at_setup_line: "])
   AS_ECHO_N(["$at_group. $at_setup_line: "]) >> "$at_group_log"
@@ -1903,7 +1904,7 @@ _AT_DEFINE_SETUP([AT_CHECK_NOESCAPE],
 
 # _AT_DECIDE_TRACEABLE(COMMANDS)
 # ------------------------------
-# Worker for for _AT_CHECK that expands to shell code.  If COMMANDS are safe to
+# Worker for _AT_CHECK that expands to shell code.  If COMMANDS are safe to
 # trace with `set -x', the shell code will evaluate to true.  Otherwise,
 # the shell code will print a message stating an aspect of COMMANDS that makes
 # tracing them unsafe, and evaluate to false.
@@ -2042,7 +2043,7 @@ m4_define([AT_DIFF_STDOUT()],
 # filter out the unadorned trace lines, we disable shell tracing entirely for
 # commands that could span multiple lines.
 #
-# Limiting COMMANDS to a single command is not good either, since them
+# Limiting COMMANDS to a single command is not good either, since then
 # the user herself would use {} or (), and then we face the same problem.
 #
 # But then, there is no point in running
index 1ed19a63abb2335529b51522793b0e7071bc09d1..a49ea1b7ff15de82e54a60e887dbab38397fcfcc 100644 (file)
@@ -236,9 +236,9 @@ AT_CLEANUP
 ]], [], [], [], [], [],
 [AT_CHECK([sed -n '/exec AS_MESSAGE_LOG_FD/q; />&AS_MESSAGE_LOG_FD/p' < micro-suite])])
 
-## ----------------------------------------------------- ##
-## Newlines and command substitutions in test commands.  ##
-## ----------------------------------------------------- ##
+## ----------------- ##
+## Status handling.  ##
+## ----------------- ##
 
 AT_CHECK_AT_TEST([Truth],
   [AT_CHECK([:], 0, [], [])])
@@ -253,6 +253,18 @@ AT_CHECK_AT_TEST([Skip],
   [], [], [], [], [],
   [AT_CHECK([grep skipped micro-suite.log], [], [ignore])])
 
+AT_CHECK_AT_TEST([Syntax error],
+  [AT_CHECK([:])
+   AT_CLEANUP
+   AT_SETUP([syntax])
+   AT_CHECK([if])
+   AT_CLEANUP
+   AT_SETUP([another test])
+   AT_CHECK([:])],
+  [], [1], [], [stderr], [],
+  [AT_CHECK([grep "unable to parse test group: 2" stderr], [0], [ignore])
+   AT_CHECK([$CONFIG_SHELL ./micro-suite 1 3], [0], [ignore])])
+
 AT_CHECK_AT_TEST([errexit],
   [AT_CHECK([false])
    AT_CLEANUP
@@ -265,6 +277,10 @@ AT_CHECK_AT_TEST([errexit],
    AT_CHECK([grep "1 .* inhibited subsequent" stderr], [], [ignore])],
   [--errexit])
 
+## ----------------------------------------------------- ##
+## Newlines and command substitutions in test commands.  ##
+## ----------------------------------------------------- ##
+
 AT_CHECK_AT_TEST([Literal multiline command],
   [AT_CHECK([echo Auto'
 'conf], 0, [Auto