]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
tests: migrate legacy suffix.test to Autotest.
authorGary V. Vaughan <gary@gnu.org>
Thu, 4 Oct 2012 14:22:06 +0000 (21:22 +0700)
committerGary V. Vaughan <gary@gnu.org>
Fri, 5 Oct 2012 09:34:43 +0000 (16:34 +0700)
* tests/suffix.test: Delete file.
* tests/libtool.at (Transform source suffices): Add Autotest
equivalent.
* Makefile.am (TESTS): Remove tests/suffix.test.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Makefile.am
tests/libtool.at
tests/suffix.test [deleted file]

index 052cbfa84d375d90f5a71d22124fc827e7f5d5f7..f3bb0e4f519191dee99878278639d859506f015a 100644 (file)
@@ -800,7 +800,6 @@ TESTS = \
        tests/link-2.test \
        tests/nomode.test \
        tests/objectlist.test \
-       tests/suffix.test \
        tests/tagtrace.test
 
 defs           = tests/defs
index ef64c3582eb0b1d69de5df6aaa9cfa9cca851be3..3fc46fcf8f5307484808751f91f108d4abd7a992 100755 (executable)
@@ -101,3 +101,31 @@ for mode in compile link install; do
 done
 
 AT_CLEANUP
+
+
+## -------------------------- ##
+## Transform source suffices. ##
+## -------------------------- ##
+
+AT_SETUP([transform source suffices])
+
+# Extensions taken from the ones that Automake recognizes, plus Objective C,
+# and GNU Ada.  Also test that multiple dots are handled correctly.
+extensions="C F S ada adb ads asm c c++ cc cpp cxx f f90 F90 f95 F95 f03 F03 for go m s sx ada.ada"
+bad_names=foo.
+
+for ext in $extensions; do
+  # Try a sample compile command.
+  AT_CHECK([$LIBTOOL -n --mode=compile compiler -c foo.$ext],
+           [1], [ignore], [stderr])
+  AT_CHECK([grep 'cannot' stderr], [1], [ignore])
+done
+
+# Make sure that invalid suffixes are not recognized.
+for name in $bad_names; do
+  AT_CHECK([$LIBTOOL -n --mode=compile compiler -c $name],
+           [1], [ignore], [stderr])
+  AT_CHECK([grep 'cannot' stderr], [0], [ignore])
+done
+
+AT_CLEANUP
diff --git a/tests/suffix.test b/tests/suffix.test
deleted file mode 100755 (executable)
index b06cb22..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /bin/sh
-# suffix.test - check that libtool knows how to transform source suffices.
-#
-#   Copyright (C) 2003-2004, 2007-2008, 2011-2012 Free Software
-#   Foundation, Inc.
-#   Written by Gary V. Vaughan, 2003
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-####
-
-# Extensions taken from the ones that Automake recognizes, plus Objective C,
-# and GNU Ada.  Also test that multiple dots are handled correctly.
-extensions="C F S ada adb ads asm c c++ cc cpp cxx f f90 F90 f95 F95 f03 F03 for go m s sx ada.ada"
-bad_names=foo.
-
-. tests/defs || exit 1
-
-status=$EXIT_SUCCESS
-for ext in $extensions; do
-  # Try a sample compile command.
-  if ($LIBTOOL -n --mode=compile compiler -c foo.$ext 2>&1; exit 0) | grep 'cannot'; then
-    status=$EXIT_FAILURE
-  else
-    echo "recognized foo.$ext as a valid source file"
-  fi
-done
-
-# Make sure that invalid suffixes are not recognized.
-for name in $bad_names; do
-  if ($LIBTOOL -n --mode=compile compiler -c $name 2>&1; exit 0) | grep 'cannot'; then :
-  else
-    echo "incorrectly recognized $name as a valid source file"
-    status=$EXIT_FAILURE
-  fi
-done
-
-exit $status