]> git.draconx.ca Git - dxcommon.git/commitdiff
Allow testsuite to run configure with alternate shells.
authorNick Bowler <nbowler@draconx.ca>
Tue, 9 Mar 2021 03:06:38 +0000 (22:06 -0500)
committerNick Bowler <nbowler@draconx.ca>
Tue, 9 Mar 2021 03:30:35 +0000 (22:30 -0500)
For portability testing of autoconf macros, it is useful to be able
to have the tests run configure with different shells.  Add a global
knob to do this: just run make check with TEST_SHELL=whatever and
the testsuite will set CONFIG_SHELL in testcases appropriately.

Or configure the whole package with CONFIG_SHELL and that will get
passed down too.

However, avoid running the testsuite itself by default with such a
shell because that's not actually what we're trying to test.

atlocal.in
tests/macros.at
testsuite.at

index 9fd159e8bfc46ad4151420ec449b0b4ce7a457f8..e19cb6aa61fc751e3cb92aa81635ffa42f39c332 100644 (file)
@@ -1,3 +1,4 @@
 : "${AWK=@AWK@}"
 : "${CC=@CC@}"
 : "${EXEEXT=@EXEEXT@}"
+: "${TEST_SHELL=@SHELL@}"
index 4c7c8ddecbb7f6edbf615b0280667eb5a57d4e21..07d23ca4b76d312b9a7e87461e6c403f97aae5c6 100644 (file)
@@ -132,7 +132,7 @@ AC_CONFIG_FILES([test])
 ]])
 
 TEST_AUTORECONF
-export LINGUAS='en_CA en'; TEST_CONFIGURE
+LINGUAS='en_CA en'; export LINGUAS; TEST_CONFIGURE
 
 AT_CHECK([cat test], [0], [[POFILES = po/en.po
 MOFILES = po/en.mo
@@ -198,43 +198,37 @@ AC_CONFIG_FILES([test])
 ]])
 TEST_AUTORECONF
 
-export LINGUAS="en"; TEST_CONFIGURE
+LINGUAS='en'; export LINGUAS; TEST_CONFIGURE
 AT_CHECK([cat test], [0],
 [[POFILES = po/en.po po/en_US.po po/ja.po po/zh.po
 MOFILES = po/en.mo
 ]])
 
-export LINGUAS="en_US"; TEST_CONFIGURE
+LINGUAS='en_US'; export LINGUAS; TEST_CONFIGURE
 AT_CHECK([cat test], [0],
 [[POFILES = po/en.po po/en_US.po po/ja.po po/zh.po
 MOFILES = po/en.mo po/en_US.mo
 ]])
 
-export LINGUAS="en_CA"; TEST_CONFIGURE
+LINGUAS='en_CA'; export LINGUAS; TEST_CONFIGURE
 AT_CHECK([cat test], [0],
 [[POFILES = po/en.po po/en_US.po po/ja.po po/zh.po
 MOFILES = po/en.mo
 ]])
 
-export LINGUAS="ja ko"; TEST_CONFIGURE
+LINGUAS='ja ko'; export LINGUAS; TEST_CONFIGURE
 AT_CHECK([cat test], [0],
 [[POFILES = po/en.po po/en_US.po po/ja.po po/zh.po
 MOFILES = po/ja.mo
 ]])
 
-export LINGUAS="ja ko"; TEST_CONFIGURE
+LINGUAS='ja_JP ko_KR'; export LINGUAS; TEST_CONFIGURE
 AT_CHECK([cat test], [0],
 [[POFILES = po/en.po po/en_US.po po/ja.po po/zh.po
 MOFILES = po/ja.mo
 ]])
 
-export LINGUAS="ja_JP ko_KR"; TEST_CONFIGURE
-AT_CHECK([cat test], [0],
-[[POFILES = po/en.po po/en_US.po po/ja.po po/zh.po
-MOFILES = po/ja.mo
-]])
-
-export LINGUAS=""; TEST_CONFIGURE
+LINGUAS=''; export LINGUAS; TEST_CONFIGURE
 AT_CHECK([cat test], [0],
 [[POFILES = po/en.po po/en_US.po po/ja.po po/zh.po
 MOFILES = @&t@
index 7e5ea5d63dc6add5c9acef160243be95ef6b320b..f25bb337be6c62f18ab447c069ffa0fe47e41635 100644 (file)
@@ -25,15 +25,26 @@ AC_OUTPUT
 cp "$srcdir/install-sh" \
    "$srcdir/depcomp" \
    "$srcdir/missing" \
-   "$srcdir/config.guess" \
    "$srcdir/config.sub" \
    .
+# Simplified config.guess script avoids some spurious testcase failures
+# when using heirloom-sh on GNU/Linux.
+config_guess=`"$srcdir/config.guess"`
+cat >config.guess <<EOF
+#!/bin/sh
+cat <<'GUESS_EOF'
+$config_guess
+GUESS_EOF
+EOF
+chmod +x config.guess
 ])
 m4_define([TEST_AUTORECONF], [AT_KEYWORDS([autoconf])dnl
 AT_CHECK([autoreconf -I "$srcdir/m4"], [0], [], [stderr])])
 
 m4_define([TEST_CONFIGURE], [AT_KEYWORDS([configure])dnl
-AT_CHECK([export CC; ./configure $1], [0], [ignore])])
+AT_CHECK([export CC
+CONFIG_SHELL=$TEST_SHELL $TEST_SHELL ./configure CONFIG_SHELL=$TEST_SHELL $1],
+[0], [ignore])])
 
 m4_include([tests/macros.at])
 m4_include([tests/snippets.at])