summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2012-10-04 21:22:06 +0700
committerGary V. Vaughan <gary@gnu.org>2012-10-05 16:34:43 +0700
commitb4f5b4695304a94055841718138b7a4c6c7daac3 (patch)
treecf567ebf5bf073f35c92c1d419960e5a339881c3 /tests
parentb078ea7ce89d9f422384b6708c8e2341b743084e (diff)
downloadlibtool-b4f5b4695304a94055841718138b7a4c6c7daac3.tar.gz
tests: migrate legacy suffix.test to Autotest.
* 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>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/libtool.at28
-rwxr-xr-xtests/suffix.test53
2 files changed, 28 insertions, 53 deletions
diff --git a/tests/libtool.at b/tests/libtool.at
index ef64c358..3fc46fcf 100755
--- a/tests/libtool.at
+++ b/tests/libtool.at
@@ -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
index b06cb22d..00000000
--- a/tests/suffix.test
+++ /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