]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
tests: migrate legacy tests/cdemo tests to Autotest.
authorGary V. Vaughan <gary@gnu.org>
Mon, 21 Nov 2011 16:15:54 +0000 (23:15 +0700)
committerGary V. Vaughan <gary@gnu.org>
Thu, 4 Oct 2012 13:11:05 +0000 (20:11 +0700)
* tests/cdemo.at: New Autotest groups, based on...
* tests/cdemo-conf.test, tests/cdemo-exec.test,
tests/cdemo-make.test, tests/cdemo-shared-exec.test,
tests/cdemo-shared-make.test, tests/cdemo-shared.test,
tests/cdemo-static-exec.test, tests/cdemo-static-make.test,
tests/cdemo-static.test, tests/cdemo-undef-exec.test,
tests/cdemo-undef-make.test, tests/cdemo-undef.test: ...these
legacy test cases, now removed.
tests/cdemo/Makefile.am, tests/cdemo/README,
tests/cdemo/configure.ac, tests/cdemo/foo.c, tests/cdemo/foo.h,
tests/cdemo/main.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/cdemo.
* Makefile.am: Adjust.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
23 files changed:
Makefile.am
configure.ac
tests/cdemo-conf.test [deleted file]
tests/cdemo-exec.test [deleted file]
tests/cdemo-make.test [deleted file]
tests/cdemo-shared-exec.test [deleted file]
tests/cdemo-shared-make.test [deleted file]
tests/cdemo-shared.test [deleted file]
tests/cdemo-static-exec.test [deleted file]
tests/cdemo-static-make.test [deleted file]
tests/cdemo-static.test [deleted file]
tests/cdemo-undef-exec.test [deleted file]
tests/cdemo-undef-make.test [deleted file]
tests/cdemo-undef.test [deleted file]
tests/cdemo.at [new file with mode: 0644]
tests/cdemo/.gitignore [deleted file]
tests/cdemo/Makefile.am [deleted file]
tests/cdemo/README [deleted file]
tests/cdemo/configure.ac [deleted file]
tests/cdemo/foo.c [deleted file]
tests/cdemo/foo.h [deleted file]
tests/cdemo/main.c [deleted file]
tests/testsuite.at

index d470d392367570dc80af0dc6b3997fb194de59b3..5b71860cb2782e9f15a95c80a16c1a4c71c7218a 100644 (file)
@@ -626,13 +626,14 @@ TESTSUITE = tests/testsuite
 TESTSUITE_AT   = tests/testsuite.at \
                  tests/getopt-m4sh.at \
                  tests/libtoolize.at \
+                 tests/cdemo.at \
+                 tests/convenience.at \
                  tests/help.at \
                  tests/duplicate_members.at \
                  tests/duplicate_conv.at \
                  tests/duplicate_deps.at \
                  tests/flags.at \
                  tests/inherited_flags.at \
-                 tests/convenience.at \
                  tests/link-order.at \
                  tests/link-order2.at \
                  tests/fail.at \
@@ -872,9 +873,6 @@ COMMON_TESTS = \
        tests/quote.test \
        tests/suffix.test \
        tests/tagtrace.test \
-       tests/cdemo-static.test \
-       tests/cdemo-static-make.test \
-       tests/cdemo-static-exec.test \
        tests/demo-static.test \
        tests/demo-static-make.test \
        tests/demo-static-exec.test \
@@ -890,9 +888,6 @@ COMMON_TESTS = \
        tests/mdemo-static-exec.test \
        tests/mdemo-static-inst.test \
        tests/mdemo-static-unst.test \
-       tests/cdemo-conf.test \
-       tests/cdemo-make.test \
-       tests/cdemo-exec.test \
        tests/demo-conf.test \
        tests/demo-make.test \
        tests/demo-exec.test \
@@ -933,17 +928,11 @@ COMMON_TESTS = \
        tests/demo-nopic.test \
        tests/demo-nopic-make.test \
        tests/demo-nopic-exec.test \
-       tests/cdemo-shared.test \
-       tests/cdemo-shared-make.test \
-       tests/cdemo-shared-exec.test \
        tests/mdemo-shared.test \
        tests/mdemo-shared-make.test \
        tests/mdemo-shared-exec.test \
        tests/mdemo-shared-inst.test \
-       tests/mdemo-shared-unst.test \
-       tests/cdemo-undef.test \
-       tests/cdemo-undef-make.test \
-       tests/cdemo-undef-exec.test
+       tests/mdemo-shared-unst.test
 
 # Actually, only demo-relink and depdemo-relink require interaction,
 # but they depend on the other tests being run beforehand.
@@ -963,18 +952,6 @@ INTERACTIVE_TESTS = \
        tests/depdemo-relink.test \
        tests/depdemo-shared-unst.test
 
-tests/cdemo-undef-exec.log:    tests/cdemo-undef-make.log
-tests/cdemo-undef-make.log:    tests/cdemo-undef.log
-tests/cdemo-undef.log: $(ORDER)        tests/cdemo-shared-exec.log
-tests/cdemo-shared-exec.log:   tests/cdemo-shared-make.log
-tests/cdemo-shared-make.log:   tests/cdemo-shared.log
-tests/cdemo-shared.log: $(ORDER) tests/cdemo-exec.log
-tests/cdemo-exec.log:          tests/cdemo-make.log
-tests/cdemo-make.log:          tests/cdemo-conf.log
-tests/cdemo-conf.log: $(ORDER) tests/cdemo-static-exec.log
-tests/cdemo-static-exec.log:   tests/cdemo-static-make.log
-tests/cdemo-static-make.log:   tests/cdemo-static.log
-
 tests/demo-shared-unst.log:    tests/demo-noinst-link.log
 tests/demo-noinst-link.log:    tests/demo-relink.log
 tests/demo-relink.log:         tests/demo-hardcode.log
index 517f70664759ba15ee3af6e8f386f349a19c6414..5384ddf40ca06e39396c601cc799a02811e683f4 100644 (file)
@@ -126,7 +126,7 @@ AC_SUBST([pkgaux_scripts])
 
 # All subdirectories that are configured on demand, but that must be
 # included in the distribution.
-CONF_SUBDIRS="tests/cdemo tests/demo tests/depdemo tests/f77demo tests/fcdemo \
+CONF_SUBDIRS="tests/demo tests/depdemo tests/f77demo tests/fcdemo \
        tests/mdemo tests/mdemo2 tests/pdemo tests/tagdemo"
 AC_SUBST([CONF_SUBDIRS])
 
diff --git a/tests/cdemo-conf.test b/tests/cdemo-conf.test
deleted file mode 100755 (executable)
index 4869730..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# cdemo-conf.test - try configuring the cdemo subdirectory
-#
-#   Copyright (C) 2003, 2004 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.
-####
-
-. tests/defs || exit 1
-
-func_mkprefixdir
-func_cd "tests/cdemo"
-func_make_distclean
-func_configure
-func_check_static_shared "yes" "yes"
-
-exit 0
diff --git a/tests/cdemo-exec.test b/tests/cdemo-exec.test
deleted file mode 100755 (executable)
index dce62f2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# cdemo-exec.test - check that programs in the cdemo subdirectory are viable
-#
-#   Copyright (C) 2003, 2004 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.
-####
-
-. tests/defs || exit 1
-
-func_require "cdemo-make" "tests/cdemo/cdemo$EXEEXT"
-
-func_rmprefixdir
-func_exec_init "uninstalled"
-func_exec "tests/cdemo/cdemo$EXEEXT"
-
-exit $exec_status
diff --git a/tests/cdemo-make.test b/tests/cdemo-make.test
deleted file mode 100755 (executable)
index 08e70a5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# cdemo-make.test - try building in the cdemo subdirectory
-#
-#   Copyright (C) 2003, 2004 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.
-####
-
-. tests/defs || exit 1
-
-func_require "cdemo-conf" "tests/cdemo/Makefile"
-
-func_rmprefixdir
-func_cd "tests/cdemo"
-func_make
-
-exit 0
diff --git a/tests/cdemo-shared-exec.test b/tests/cdemo-shared-exec.test
deleted file mode 100755 (executable)
index c784065..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/cdemo-exec.test
diff --git a/tests/cdemo-shared-make.test b/tests/cdemo-shared-make.test
deleted file mode 100755 (executable)
index 254b3d4..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/cdemo-make.test
diff --git a/tests/cdemo-shared.test b/tests/cdemo-shared.test
deleted file mode 100755 (executable)
index 2d58bd3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# cdemo-shared.test - try configuring the cdemo subdirectory for shared libs
-#
-#   Copyright (C) 2003, 2004 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.
-####
-
-. tests/defs || exit 1
-
-func_mkprefixdir
-func_cd "tests/cdemo"
-func_make_distclean
-func_configure "--disable-static"
-func_check_static_shared "no" "yes"
-
-exit 0
diff --git a/tests/cdemo-static-exec.test b/tests/cdemo-static-exec.test
deleted file mode 100755 (executable)
index c784065..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/cdemo-exec.test
diff --git a/tests/cdemo-static-make.test b/tests/cdemo-static-make.test
deleted file mode 100755 (executable)
index 254b3d4..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/cdemo-make.test
diff --git a/tests/cdemo-static.test b/tests/cdemo-static.test
deleted file mode 100755 (executable)
index 36ac2c5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# cdemo-static.test - try configuring the cdemo subdirectory for static libs
-#
-#   Copyright (C) 2003, 2004 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.
-####
-
-. tests/defs || exit 1
-
-func_mkprefixdir
-func_cd "tests/cdemo"
-func_make_distclean
-func_configure "--disable-shared"
-func_check_static_shared "yes" "no"
-
-exit 0
diff --git a/tests/cdemo-undef-exec.test b/tests/cdemo-undef-exec.test
deleted file mode 100755 (executable)
index c784065..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/cdemo-exec.test
diff --git a/tests/cdemo-undef-make.test b/tests/cdemo-undef-make.test
deleted file mode 100755 (executable)
index 254b3d4..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/cdemo-make.test
diff --git a/tests/cdemo-undef.test b/tests/cdemo-undef.test
deleted file mode 100755 (executable)
index 732e355..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#! /bin/sh
-# cdemo-undef - test generating shared libraries with undefined symbols
-#
-#   Copyright (C) 2003, 2004, 2008 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.
-####
-
-. tests/defs || exit 1
-
-func_mkprefixdir
-func_cd "tests/cdemo"
-func_make_distclean
-func_configure "--disable-static"
-
-grep '^allow_undefined_flag=.\{0,1\}unsupported.\{0,1\}$' ./libtool >/dev/null 2>&1 \
-    && func_skip "$host doesn't support undefined symbols in shared libs"
-
-if test -f ./libtool; then
-  $SED 's|allow_undefined=no|allow_undefined=yes|g' ./libtool > ltnew
-else
-  exit 1
-fi
-
-if test -f ./ltnew; then
-  rm -f libtool
-  mv ltnew libtool
-else
-  exit 1
-fi
-
-exit 0
diff --git a/tests/cdemo.at b/tests/cdemo.at
new file mode 100644 (file)
index 0000000..7a2f369
--- /dev/null
@@ -0,0 +1,193 @@
+# cdemo.at -- Using Automake to build a program and library -*- Autotest -*-
+#
+#   Copyright (C) 2003, 2004, 2011 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.
+####
+
+
+AT_BANNER([Convenience libraries.])
+
+
+# _LT_SETUP
+# ---------
+m4_define([_LT_SETUP],
+[AT_DATA([configure.ac],
+[[AC_INIT([cdemo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+LT_INIT
+AC_SUBST([LIBTOOL_DEPS])
+LT_LIB_M
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_HEADERS([config.h:config.in.h])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.am],
+[[AUTOMAKE_OPTIONS = no-dependencies foreign
+ACLOCAL_AMFLAGS = -I m4
+
+noinst_LTLIBRARIES = libfoo.la
+libfoo_la_SOURCES = foo.c
+libfoo_la_LIBADD = $(LIBM)
+libfoo_la_LDFLAGS = -no-undefined
+noinst_HEADERS = foo.h
+
+bin_PROGRAMS = cdemo
+cdemo_SOURCES = main.c
+cdemo_LDADD = libfoo.la
+
+libtool: $(LIBTOOL_DEPS)
+        $(SHELL) ./config.status --recheck
+]])
+
+AT_DATA([foo.h],
+[[#ifndef FOO_H
+#define FOO_H 1
+
+/* Silly constants that the functions return. */
+#define HELLO_RET 0xe110
+#define FOO_RET 0xf00
+
+extern int foo();
+
+extern int hello();
+
+#endif
+]])
+
+AT_DATA([foo.c],
+[[#include <config.h>
+#include <stdio.h>
+#include <math.h>
+
+#include "foo.h"
+
+int foo() {
+  printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
+  return FOO_RET;
+}
+
+int hello() {
+  printf ("** This is libfoo **\n");
+  return HELLO_RET;
+}
+]])
+
+AT_DATA([main.c],
+[[#include <config.h>
+#include <stdio.h>
+#include "foo.h"
+
+int main ()
+{
+  int value;
+
+  printf ("Welcome to GNU libtool cdemo!\n");
+
+  value = hello();
+  printf ("hello returned: %i\n", value);
+  if (value == HELLO_RET)
+    printf("hello is ok!\n");
+
+  if (foo () == FOO_RET)
+    printf("foo is ok!\n");
+
+  return 0;
+}
+]])
+
+AT_DATA([expout],
+[[Welcome to GNU libtool cdemo!
+** This is libfoo **
+hello returned: 57616
+hello is ok!
+cos (0.0) = 1
+foo is ok!
+]])
+]) # _LT_SETUP
+
+
+## ------------- ##
+## Cdemo static. ##
+## ------------- ##
+
+AT_SETUP([build and link against a static library])
+
+_LT_SETUP
+
+LT_AT_CHECK_CONFIG([--disable-shared],
+                   [^build_old_libs=yes], [^build_libtool_libs=no])
+LT_AT_CHECK_EXECUTE([], [./cdemo])
+
+AT_CLEANUP
+
+
+## ------------- ##
+## Cdemo shared. ##
+## ------------- ##
+
+AT_SETUP([build and link against a dynamic library])
+
+_LT_SETUP
+
+LT_AT_CHECK_CONFIG([--disable-static],
+                   [^build_old_libs=no], [^build_libtool_libs=yes])
+LT_AT_CHECK_EXECUTE([], [./cdemo])
+
+AT_CLEANUP
+
+
+## ----------- ##
+## Cdemo conf. ##
+## ----------- ##
+
+AT_SETUP([build both static and dynamic])
+
+_LT_SETUP
+
+LT_AT_CHECK_CONFIG([],
+                   [^build_old_libs=yes], [^build_libtool_libs=yes])
+LT_AT_CHECK_EXECUTE([], [./cdemo])
+
+AT_CLEANUP
+
+
+## ------------ ##
+## Cdemo undef. ##
+## ------------ ##
+
+AT_SETUP([allow_undefined_flag])
+
+_LT_SETUP
+
+LT_AT_CHECK_CONFIG([--disable-static])
+
+AT_CHECK([$EGREP "^allow_undefined_flag=.\{0,1\}unsupported.\{0,1\}$" libtool && (exit 77)],
+          1, [ignore])
+
+sed 's|allow_undefined=no|allow_undefined=yes|g' libtool > ltnew && mv -f ltnew libtool
+
+LT_AT_CHECK_EXECUTE([], [./cdemo])
+
+AT_CLEANUP
diff --git a/tests/cdemo/.gitignore b/tests/cdemo/.gitignore
deleted file mode 100644 (file)
index f8d8b0e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/cdemo
diff --git a/tests/cdemo/Makefile.am b/tests/cdemo/Makefile.am
deleted file mode 100644 (file)
index 148ca53..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-## Makefile.am -- Process this file with automake to produce Makefile.in
-##
-##   Copyright (C) 2003, 2004, 2005 Free Software Foundation
-##   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.
-#####
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS  = -I ../../m4
-AM_CPPFLAGS     = -I$(top_srcdir)/../..
-
-noinst_LTLIBRARIES = libfoo.la
-
-libfoo_la_SOURCES = foo.c
-libfoo_la_LIBADD = $(LIBM)
-libfoo_la_LDFLAGS = -no-undefined
-
-noinst_HEADERS = foo.h
-
-bin_PROGRAMS = cdemo
-
-cdemo_SOURCES = main.c
-cdemo_LDADD = libfoo.la
-
-libtool: $(LIBTOOL_DEPS)
-       $(SHELL) ./config.status --recheck
-
-# Workaround a bug in Autoconf-2.61 and earlier that don't clean up
-# file droppings left by many compilers:
-distclean-local:
-       ac_files="a.out.* a.exe.* a_out.exe.* b.out.* conftest.*"; \
-       for ac_file in $$ac_files; do \
-         case $$ac_file in \
-           *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) rm -rf $$ac_file ;; \
-         esac; \
-       done
diff --git a/tests/cdemo/README b/tests/cdemo/README
deleted file mode 100644 (file)
index fd3e418..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-This is cdemo, an example package that uses GNU libtool with an
-Automake-generated environment to build two simple libraries and programs.
-
-It demonstrates how to build convenience libraries
diff --git a/tests/cdemo/configure.ac b/tests/cdemo/configure.ac
deleted file mode 100644 (file)
index e008f72..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-# Process this file with autoconf to create configure. -*- autoconf -*-
-#
-#   Copyright (C) 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
-#
-#   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.
-####
-
-AC_PREREQ(2.54)
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([cdemo], [1.0], [bug-libtool@gnu.org])
-AC_CONFIG_SRCDIR([main.c])
-AC_CONFIG_AUX_DIR([../../build-aux])
-
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE
-
-
-## ------------------ ##
-## C compiler checks. ##
-## ------------------ ##
-AC_PROG_CC
-
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-LT_INIT
-AC_SUBST([LIBTOOL_DEPS])
-
-
-## ---------------------------- ##
-## Libraries required by cdemo. ##
-## ---------------------------- ##
-LT_LIB_M
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/tests/cdemo/foo.c b/tests/cdemo/foo.c
deleted file mode 100644 (file)
index b522fec..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* foo.c -- trivial test library
-
-   Copyright (C) 1998-1999, 2007 Free Software Foundation, Inc.
-   Written by Thomas Tanner, 1998
-
-  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.
-*/
-
-#include "foo.h"
-#include <stdio.h>
-
-#include <math.h>
-
-int
-foo()
-{
-  printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
-  return FOO_RET;
-}
-
-int
-hello()
-{
-  printf ("** This is libfoo **\n");
-  return HELLO_RET;
-}
diff --git a/tests/cdemo/foo.h b/tests/cdemo/foo.h
deleted file mode 100644 (file)
index ae66563..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* foo.h -- interface to the libfoo* libraries
-
-   Copyright (C) 1998-1999 Free Software Foundation, Inc.
-   Written by Thomas Tanner, 1998
-
-   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.
-*/
-
-/* Only include this header file once. */
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-/* Silly constants that the functions return. */
-#define HELLO_RET 0xe110
-#define FOO_RET 0xf00
-
-extern int foo();
-
-extern int hello();
-
-#endif /* !_FOO_H_ */
diff --git a/tests/cdemo/main.c b/tests/cdemo/main.c
deleted file mode 100644 (file)
index aef8bf0..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* main.c -- cdemo test program
-
-   Copyright (C) 1998-1999, 2006 Free Software Foundation, Inc.
-   Written by Thomas Tanner, 1998
-
-   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.
-*/
-
-#include "foo.h"
-#include <stdio.h>
-
-
-int
-main ()
-{
-  int value;
-
-  printf ("Welcome to GNU libtool cdemo!\n");
-
-  value = hello();
-  printf ("hello returned: %i\n", value);
-  if (value == HELLO_RET)
-    printf("hello is ok!\n");
-
-  if (foo () == FOO_RET)
-    printf("foo is ok!\n");
-
-  return 0;
-}
index bb4b875cc1ef5526ed4447a7b6f78d4cf1dbf5c5..b8aeb1359635b8d9b8dac87a8ba1853d3677b227 100644 (file)
@@ -208,6 +208,22 @@ m4_define([LT_AT_CHECK],
 [echo "LT_ESCAPE([$1])"; AT_CHECK($@)])
 
 
+# LT_AT_CHECK_CONFIG (CONFIGURE-ARGS, [GREP-EXPRESSION], ...)
+# -----------------------------------------------------------
+# Bootstrap and configure the project, and check each GREP-EXPRESSION
+# works on the resulting libtool script.
+m4_define([LT_AT_CHECK_CONFIG],
+[LT_AT_BOOTSTRAP([], [-I m4], [], [--add-missing], [],
+        [--prefix="$prefixdir" $1], [ignore])
+m4_if([$#], 0, [],
+      [$#], 1, [], [$0_(m4_shift($@))])
+])
+m4_define([LT_AT_CHECK_CONFIG_],
+[AT_CHECK([$EGREP '$1' libtool], 0, [ignore])
+ m4_if([$#], 1, [], [$0(m4_shift($@))])
+])
+
+
 # LT_AT_HOST_DATA(FILE, CONTENTS)
 # -------------------------------
 # Ensure correct line ending for expected output of host executables.