[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/14] New requirement "c++" for tests using a C++ compiler.
From: |
Stefano Lattarini |
Subject: |
[PATCH 05/14] New requirement "c++" for tests using a C++ compiler. |
Date: |
Fri, 2 Jul 2010 14:07:53 +0200 |
User-agent: |
KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; ) |
New requirement "c++" for tests using a C++ compiler.
* tests/lflags2.test ($requiered): Require "c++", not "g++".
* tests/silent5.test: Likewise.
* tests/silentcxx.test: Likewise.
* tests/specflg10.test: Likewise.
* tests/yflags2.test: Likewise.
* tests/subobj9.test: Likewise, and do not SKIP if ./configure
fails.
Ideas from Ralf Wildenhues and Stefano Lattarini. Final patch
by Stefano Lattarini.
-*-*-*-
NOTE: this patch won't be followed by a patch "Make sure all tests
needing C++ compiler require it explicitly." (like it was done for the
"cc" requirement), as apparently all tests needing a C++ compiler were
already dutifully requiring "g++".
Checked (after the application of the presnet patch) with:
$ cd ~/src/automake/tests
$ tests=$(echo `egrep -l '(CXX|\.(cc|c\+\+|cpp|cxx))' *.test`)
$ CXX=no nice -n19 check -j32 TESTS="$tests"
Only SKIPs and PASSes were reported, and an XFAIL (in cond17.test,
which however is easily seen by direct inspection not to require a C++
compiler).
From 76eea553fe94af82d7abd21f82855e63eb2922cb Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Fri, 2 Jul 2010 12:41:29 +0200
Subject: [PATCH 05/14] New requirement "c++" for tests using a C++ compiler.
* tests/lflags2.test ($requiered): Require "c++", not "g++".
* tests/silent5.test: Likewise.
* tests/silentcxx.test: Likewise.
* tests/specflg10.test: Likewise.
* tests/yflags2.test: Likewise.
* tests/subobj9.test: Likewise, and do not SKIP if ./configure
fails.
Ideas from Ralf Wildenhues and Stefano Lattarini. Final patch
by Stefano Lattarini.
---
ChangeLog | 18 ++++++++++++++++++
tests/defs.in | 14 ++++++++++++++
tests/lflags2.test | 2 +-
tests/silent5.test | 4 ++--
tests/silentcxx.test | 2 +-
tests/specflg10.test | 2 +-
tests/subobj9.test | 5 ++---
tests/yflags2.test | 2 +-
8 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9dc37d3..f0e3ff6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,22 @@
2010-07-02 Stefano Lattarini <address@hidden>
+ Ralf Wildenhues <address@hidden>
+
+ New requirement "c++" for tests using a C++ compiler.
+ * tests/defs.in: Recognize a new requirement "c++", asking for
+ a generic C++ compiler. For the moment, just skip the test if
+ $CXX is "no", and look for g++ (exporting CC=g++) if $CXX is
+ not set.
+ * tests/lflags2.test ($requiered): Require "c++", not "g++".
+ * tests/silent5.test: Likewise.
+ * tests/silentcxx.test: Likewise.
+ * tests/specflg10.test: Likewise.
+ * tests/yflags2.test: Likewise.
+ * tests/subobj9.test: Likewise, and do not SKIP if ./configure
+ fails.
+ Ideas from Ralf Wildenhues and Stefano Lattarini. Final patch
+ by Stefano Lattarini.
+
+2010-07-02 Stefano Lattarini <address@hidden>
Make sure all tests needing a C compiler require it explicitly.
* tests/aclocal4.test ($required): Add `cc'.
diff --git a/tests/defs.in b/tests/defs.in
index 3fef7b1..426424d 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -151,6 +151,20 @@ do
( $GCJ --version ) || exit 77
( $GCJ -v ) || exit 77
;;
+ c++)
+ if test x"$CXX" = x"no"; then
+ # The user told explicitly it don't want a C++ compiler to be used.
+ echo "$me: \$CXX is \"no\", skipping test"
+ exit 77
+ elif test -z "$CXX"; then
+ # The user specified no explicit compiler in its environment, so
+ # we try to force the use of g++ as C++ compiler.
+ CXX=g++
+ export CXX
+ echo "$me: running $CXX --version"
+ ( $CXX --version ) || exit 77
+ fi
+ ;;
g++)
CXX=g++
export CXX
diff --git a/tests/lflags2.test b/tests/lflags2.test
index df766b2..bbaf669 100755
--- a/tests/lflags2.test
+++ b/tests/lflags2.test
@@ -19,7 +19,7 @@
# Please keep this in sync with the sister tests lflags.test, yflags.test
# and yflags2.test
-required=g++ # FIXME: any working C++ compiler should be OK
+required=c++
. ./defs || Exit 1
set -e
diff --git a/tests/silent5.test b/tests/silent5.test
index 2e7eb9d..1c350e6 100755
--- a/tests/silent5.test
+++ b/tests/silent5.test
@@ -19,8 +19,8 @@
# a stress test by using many different languages at once -- so don't
# remove this test script.
-# FIXME: generic C++/Fortran compilers should suffice here
-required='cc g++ gfortran flex bison'
+# FIXME: a generic Fortran compiler should suffice here
+required='cc c++ gfortran flex bison'
. ./defs
set -e
diff --git a/tests/silentcxx.test b/tests/silentcxx.test
index aa64d8f..72e409f 100755
--- a/tests/silentcxx.test
+++ b/tests/silentcxx.test
@@ -16,7 +16,7 @@
# Check silent-rules mode for C++.
-required='g++' # FIXME: any decent C++ compiler should be OK
+required='c++'
. ./defs
set -e
diff --git a/tests/specflg10.test b/tests/specflg10.test
index 76eb346..2f358b2 100755
--- a/tests/specflg10.test
+++ b/tests/specflg10.test
@@ -16,7 +16,7 @@
# AM_DEFAULT_SOURCE_EXT
-required='cc g++'
+required='cc c++'
. ./defs || Exit 1
set -e
diff --git a/tests/subobj9.test b/tests/subobj9.test
index 2b331e0..91eeca3 100755
--- a/tests/subobj9.test
+++ b/tests/subobj9.test
@@ -16,7 +16,7 @@
# Test for PR 312.
-required='libtoolize g++'
+required='libtoolize c++'
. ./defs || Exit 1
cat > configure.in << 'END'
@@ -62,8 +62,7 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-# Skip this test on configure errors (e.g., broken C++ compilers).
-./configure || Exit 77
+./configure
# opportunistically check that --tag=CXX is used when supported
if test -n "`./libtool --help | grep tag=TAG`"; then
diff --git a/tests/yflags2.test b/tests/yflags2.test
index 346c2e4..89a1439 100755
--- a/tests/yflags2.test
+++ b/tests/yflags2.test
@@ -19,7 +19,7 @@
# Please keep this in sync with the sister tests yflags.test, lflags.test
# and lflags2.test
-required=g++ # FIXME: any working C++ compiler should be OK
+required=c++
. ./defs || Exit 1
set -e
--
1.6.5
- [PATCH 0/14] Fix/improve requirements declaration for test scripts., Stefano Lattarini, 2010/07/02
- [PATCH 01/14] New requirement "cc" for tests using a C compiler., Stefano Lattarini, 2010/07/02
- [PATCH 02/14] Drop useless "cc" requirement from a test script., Stefano Lattarini, 2010/07/02
- [PATCH 03/14] Do not SKIP a test on a command failing with `77' exit status., Stefano Lattarini, 2010/07/02
- [PATCH 04/14] Make sure all tests needing C compiler require it explicitly., Stefano Lattarini, 2010/07/02
- [PATCH 05/14] New requirement "c++" for tests using a C++ compiler.,
Stefano Lattarini <=
- [PATCH 06/14] Fix `silent*.test' for C++ compilers with "weird" names., Stefano Lattarini, 2010/07/02
- [PATCH 07/14] Make sure silent*.test work with non-GNU C compilers., Stefano Lattarini, 2010/07/02
- [PATCH 08/14] Fixes/renamings for "synced tests" among `silent*.test'., Stefano Lattarini, 2010/07/02
- [PATCH 09/14] Refactor code requiring compilers in testsuite., Stefano Lattarini, 2010/07/02
- [PATCH 10/14] Tests: new requirements "fortran" and "fortran77", Stefano Lattarini, 2010/07/02
- [PATCH 11/14] Fix code for requiring gfortran in tests., Stefano Lattarini, 2010/07/02
- [PATCH 12/14] Refactor code requiring compilers in testsuite., Stefano Lattarini, 2010/07/02
- [PATCH 13/14] Clobber global CFLAGS etc. when requiring GNU compilers., Stefano Lattarini, 2010/07/02
- Re: [PATCH 0/14] Fix/improve requirements declaration for test scripts., Stefano Lattarini, 2010/07/02