]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Factorize testing gcj installation in the testsuite.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 8 Jun 2010 20:41:41 +0000 (22:41 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 9 Jun 2010 17:41:13 +0000 (19:41 +0200)
* tests/testsuite.at (LT_AT_TAG): For the GCJ tag, actually
try to compile a .java file when deciding whether to skip.
(LT_AT_EXEC_TAG): New macro, to also ensure runnability.
* tests/convenience.at (Java convenience archives): Use
LT_AT_EXEC_TAG, simplify accordingly.
* tests/flags.at (passing lt_tag flags through libtool): Use
m4_defn for tag so LT_AT_TAG works.
* tests/infer-tag.at (GCJ inferred tag): Simplify.
* THANKS: Update.
Report by Warren Dodge.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
THANKS
tests/convenience.at
tests/flags.at
tests/infer-tag.at
tests/testsuite.at

index 78b5d7d73aeb4357a5e879a31b00e528d94948a2..24de21d0f213a538e1f99c1daf852c6f4ea1dc25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-06-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Factorize testing gcj installation in the testsuite.
+       * tests/testsuite.at (LT_AT_TAG): For the GCJ tag, actually
+       try to compile a .java file when deciding whether to skip.
+       (LT_AT_EXEC_TAG): New macro, to also ensure runnability.
+       * tests/convenience.at (Java convenience archives): Use
+       LT_AT_EXEC_TAG, simplify accordingly.
+       * tests/flags.at (passing lt_tag flags through libtool): Use
+       m4_defn for tag so LT_AT_TAG works.
+       * tests/infer-tag.at (GCJ inferred tag): Simplify.
+       * THANKS: Update.
+       Report by Warren Dodge.
+
 2010-06-09  Peter O'Gorman  <peter@pogma.com>
 
        Skip demo-nopic tests if SELinux policy will cause failure.
diff --git a/THANKS b/THANKS
index 14ab56b5f8b52602193e56dc741d89b789f93751..dc61c4330588cf2bc0ad4ad13a9acf0eae7de4f6 100644 (file)
--- a/THANKS
+++ b/THANKS
   Tom Tromey                   tromey@cygnus.com
   Tor Lillqvist                        tml@iki.fi
   Ulrich Drepper               drepper@ipd.info.uni-karlsruhe.de
+  Warren Dodge                 warren.l.dodge@Tektronix.com
   Vadim Zeitlin                        vz-libtool@zeitlins.org
   Vincent Lefevre              vincent@vinc17.org
   Vincent Torri                        vtorri@univ-evry.fr
index 339c59af78b83c0572d2a12f0d41ccc9542c568b..f076e61a0f74a88cac62996ead81f70d2c976423 100644 (file)
@@ -1,6 +1,7 @@
 # convenience.at -- testing C convenience archives            -*- Autotest -*-
 
-#   Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation,
+#   Inc.
 #   Written by Ralf Wildenhues, 2005
 #
 #   This file is part of GNU Libtool.
@@ -227,7 +228,7 @@ AT_CLEANUP
 
 
 AT_SETUP([Java convenience archives])
-LT_AT_TAG([GCJ])
+LT_AT_EXEC_TAG([GCJ])
 AT_KEYWORDS([libtool])
 
 cat >foo1.java <<EOF
@@ -259,15 +260,6 @@ public class A$i {
 };
 EOF
 
-  # There are just too many broken gcj installations out there, either missing
-  # libgcj.spec or unable to find it.  Skip this test for them.
-  if test $i -eq 1; then
-    AT_CHECK([$GCJ $GCJFLAGS -c foo1.java || exit 77], [], [ignore], [ignore])
-    AT_CHECK([$GCJ $GCJFLAGS --main=foo1 -o foo1$EXEEXT foo1.java A1.java || exit 77],[],[ignore],[ignore])
-    AT_CHECK([./foo1$EXEEXT || exit 77],[],[ignore],[ignore])
-    rm -f foo1.o foo1.obj foo1$EXEEXT
-  fi
-
   $LIBTOOL --tag=GCJ --mode=compile $GCJ $GCJFLAGS -c foo$i.java
   $LIBTOOL --tag=GCJ --mode=compile $GCJ $GCJFLAGS -c A$i.java
   $LIBTOOL --tag=GCJ --mode=link $GCJ $GCJFLAGS $LDFLAGS -o liba$i.la A$i.lo
index eceda744d346b5e25ca4944470a5a89afa3258b1..7f600be170075b34d4456b5466174950592ad750 100644 (file)
@@ -1,6 +1,6 @@
 # flags.at -- libtool passing of flags             -*- Autotest -*-
 #
-#   Copyright (C) 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 #
 #   This file is part of GNU Libtool.
 #
@@ -24,7 +24,7 @@
 m4_foreach([lt_tag], [CC, CXX, F77, FC, GCJ],
 [AT_SETUP([passing lt_tag flags through libtool])
 AT_KEYWORDS([libtool])
-LT_AT_TAG([lt_tag])
+LT_AT_TAG(m4_defn([lt_tag]))
 
 LDFLAGS="$LDFLAGS -no-undefined"
 eval "`$LIBTOOL --config | $EGREP '^(FGREP)='`"
index ebc7581c2a88ad001df0436ece45796df774c92f..57dd728a83a801cad5268fae8ead2cadbefe8b92 100644 (file)
@@ -1,6 +1,6 @@
 # infer-tag.at -- libtool without --tag             -*- Autotest -*-
 #
-#   Copyright (C) 2008 Free Software Foundation, Inc.
+#   Copyright (C) 2008, 2010 Free Software Foundation, Inc.
 #
 #   This file is part of GNU Libtool.
 #
@@ -91,10 +91,6 @@ AT_DATA([A.java],
 };
 ]])
 
-# There are just too many broken gcj installations out there, either missing
-# libgcj.spec or unable to find it.  Skip this test for them.
-AT_CHECK([$GCJ $GCJFLAGS -c A.java || exit 77], [], [ignore], [ignore])
-
 AT_CHECK([$LIBTOOL --mode=compile $GCJ $GCJCFLAGS -c A.java],
         [], [ignore], [ignore])
 
index 71b9dc47a4bc5defce08c1e7a6fb7a9e87abb867..423e54461f0099c44bc4c69e79be43dc1ff48092 100644 (file)
@@ -275,11 +275,38 @@ AT_CHECK([if $LIBTOOL --mode=execute $2 "$lt_exe" $6; then :; else lt_status=$?;
 
 # LT_AT_TAG(TAG)
 # --------------
+# Declare that the language TAG will be used in this test.
+# Skips the test if the compiler is apparently not functional.
 m4_define([LT_AT_TAG],
 [AT_KEYWORDS([$1])
 AT_CHECK([{ test -n "[$]$1" && test "X[$]$1" != Xno; } || (exit 77)])
-m4_if([$1], [CXX],
-  [AT_CHECK([test "X$CXX" != Xg++ || (g++ -v >/dev/null 2>&1) || (exit 77)])])
+m4_case([$1],
+  [CXX],
+  [AT_CHECK([test "X$CXX" != Xg++ || (g++ -v >/dev/null 2>&1) || (exit 77)])],
+  [GCJ],
+  [# There are just too many broken gcj installations out there, either missing
+   # libgcj.spec or unable to find it.  Skip the test for them.
+   AT_DATA([gcj_test.java],
+[[public class gcj_test {
+    public static void main(String[] argv) { }
+  }
+]])
+   AT_CHECK([$GCJ $GCJFLAGS -c gcj_test.java || exit 77],
+           [], [ignore], [ignore])])
+])
+
+
+# LT_AT_EXEC_TAG([TAG])
+# ---------------------
+# Declare that the language TAG will be used and compiled programs may be run.
+# Skips the test if the compiler is apparently not functional.
+m4_define([LT_AT_EXEC_TAG],
+[LT_AT_TAG([$1])
+m4_case([$1],
+  [GCJ],
+  [AT_CHECK([$GCJ $GCJFLAGS --main=gcj_test -o gcj_test$EXEEXT gcj_test.java ]dnl
+           [|| exit 77], [], [ignore], [ignore])
+   AT_CHECK([./gcj_test$EXEEXT || exit 77], [], [ignore], [ignore])])
 ])