autoconf-patches
[Top][All Lists]
Advanced

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

test autotest portably (Solaris)


From: Ralf Wildenhues
Subject: test autotest portably (Solaris)
Date: Wed, 1 Mar 2006 20:34:56 +0100
User-agent: Mutt/1.5.9i

In tests/autotest.at, the checks
| Parenthetical command substition
and
| Multiline parenthetical command substition

use the $(cmd) style command substition, which is not portable.

So, let's put in an AT_XFAIL_IF.  Hmm.  Doesn't work:
AT_CHECK_AT creates a `micro_suite' which is executed as
  ./micro_suite
i.e., by `/bin/sh'.  But the `testsuite' script has exported
CONFIG_SHELL as some sane shell; so the detect-better-shell
algo of `micro_suite' will think it is done already.  Bad.

Two different ways out of this: Either invoke micro_suite as
  $CONFIG_SHELL ./micro_suite
to force it to be the same shell we did the XFAIL test with,
or empty the variable:
  CONFIG_SHELL= ./micro_suite
as the detect-better-shell algo is the same in `micro_suite',
so it should find the same better shell.

OK to go for the former?  Both fix two out of very many failures
on solaris2.6.  Many of the remaining dozens of failures there
are fixed in a subsequent patch..

Cheers,
Ralf

        * tests/autotest.at (AT_NO_CMDSUBST): New macro to determine
        XFAIL condition for `$(cmd)' style command substitutions.
        (Parenthetical command substition, Multiline parenthetical
        command substition): Use it.
        * AT_CHECK_AT: Execute `./micro-suite' with $CONFIG_SHELL, so
        we test the same shell we determined above XFAIL condition with.

Index: tests/autotest.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/autotest.at,v
retrieving revision 1.8
diff -u -r1.8 autotest.at
--- tests/autotest.at   23 Aug 2005 08:57:24 -0000      1.8
+++ tests/autotest.at   1 Mar 2006 19:55:54 -0000
@@ -47,8 +47,8 @@
 # log file it generates will overwrite the log that the Autoconf test
 # suite produces for this test case.
 AT_CHECK_AUTOM4TE([--language=autotest -o micro-suite mysuite.at])
-AT_CHECK([./micro-suite],       m4_default([$4], 0), [ignore], [$6])
-AT_CHECK([./micro-suite -v -x], m4_default([$4], 0), [ignore], [$6])
+AT_CHECK([$CONFIG_SHELL ./micro-suite],       m4_default([$4], 0), [ignore], 
[$6])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -v -x], m4_default([$4], 0), [ignore], 
[$6])
 AT_CLEANUP
 ])
 
@@ -69,6 +69,11 @@
 m4_pattern_allow([^AT_])
 
 
+# AT_NO_CMDSUBST
+# --------------
+m4_define([AT_NO_CMDSUBST],
+[if ( eval 'echo $(echo)' ) >/dev/null 2>&1; then false; else :; fi])
+
 ## ------------------ ##
 ## Empty test suite.  ##
 ## ------------------ ##
@@ -117,7 +122,8 @@
 
 AT_CHECK_AT_TEST([Parenthetical command substition],
   [AT_CHECK([echo $(echo hi)], 0, [hi
-], [])])
+], [])],
+  [AT_NO_CMDSUBST])
 
 AT_CHECK_AT_TEST([Multiline parenthetical command substition],
   [AT_DATA([myfile],[foo
@@ -125,7 +131,8 @@
 ])
    AT_CHECK([echo "$(cat myfile)"], 0, [foo
 bar
-], [])])
+], [])],
+  [AT_NO_CMDSUBST])
 
 
 ## ------------------------- ##




reply via email to

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