autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

empty test


From: Eric Blake
Subject: empty test
Date: Sat, 08 Apr 2006 23:45:30 +0000

An empty test is somewhat different than an empty testsuite (although
a user should not create one, we might as well avoid the syntax
error of "( )" if they do).

2006-04-08  Eric Blake  <address@hidden>

        * lib/autotest/general.m4 (_AT_CHECK): Avoid syntax error on empty
        check.
        * tests/autotest.at (Empty test, Empty check): New test to check it.
Index: tests/autotest.at
===================================================================
RCS file: /sources/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.11
diff -u -p -r1.11 autotest.at
--- tests/autotest.at   5 Apr 2006 16:04:22 -0000       1.11
+++ tests/autotest.at   8 Apr 2006 23:28:44 -0000
@@ -84,6 +84,11 @@ AT_CHECK_AT([Empty test suite],
 [[AT_INIT([empty test suite])
 ]])
 
+# Next level of emptiness.
+AT_CHECK_AT_TEST([Empty test], [])
+
+# And finally, an empty check should not cause a syntax error.
+AT_CHECK_AT_TEST([Empty check], [AT_CHECK])
 
 ## ----------------------------------------------------- ##
 ## Newlines and command substitutions in test commands.  ##
Index: lib/autotest/general.m4
===================================================================
RCS file: /sources/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.206
diff -u -p -r1.206 general.m4
--- lib/autotest/general.m4     7 Apr 2006 18:31:09 -0000       1.206
+++ lib/autotest/general.m4     8 Apr 2006 23:28:46 -0000
@@ -1469,7 +1469,7 @@ if test -n "$at_trace_this"; then
     grep '^ *+' "$at_stder1" >&2
     grep -v '^ *+' "$at_stder1" >"$at_stderr"
 else
-    ( $1 ) >"$at_stdout" 2>"$at_stderr"
+    ( :; $1 ) >"$at_stdout" 2>"$at_stderr"
     at_status=$?
 fi
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]