libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 01/10] tests: migrate legacy tests/cdemo tests to Autotest.


From: Gary V. Vaughan
Subject: [PATCH 01/10] tests: migrate legacy tests/cdemo tests to Autotest.
Date: Fri, 25 Nov 2011 16:10:52 +0700

The best reason I can find for keeping the various demo directories
around (despite the fact we already make use of the much better test
harness of Autotest for all our new test cases) from the last time
I wanted to migrate everything out of the legacy testsuite, was that
it exercises the distribution manager's autotools combination on the
testers machine, where the Autotests always use the users autotools.
That's no argument as far as I can see: we want tests to fail as
early as possible on a users machine to help him know things are not
going to work properly if he keeps going - and having the legacy
suite pass is only encouraging users to fight with broken installs.

This series of patches migrates all 9 of the demo directory test
groups into Autotest, and allows us to remove most of the legacy
testsuite cruft at the end.  There's still a few legacy tests
left at the end, which I'll tackle later, but at least maintenance
is a whole lot easier now that we don't need to wait for 9 additional
directories to autoreconf every time we run bootstrap, or distcheck,
or roll up a distribution tarball to test on the local network.

This is all in keeping with the theme of most of the patches I've
posted this year, to make libtool easier and more fun to maintain
and contribute to, in the hope of getting more people involved.

As usual, subject to feedback, I'll push this whole series in
72 hours or so.  Make distcheck passes for me on my Mac 10.7 and
my Arch Linux x86_64 machines, but it would be great if folks with
access to other machines could give it a spin to see whether I
broke any of the tests during migration... if you'd like a pre-
rolled distro with my pending patches applied to do that, then
please do ask.

* 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 <address@hidden>
---
 Makefile.am                  |   29 +------
 configure.ac                 |    2 +-
 tests/cdemo-conf.test        |   34 -------
 tests/cdemo-exec.test        |   34 -------
 tests/cdemo-make.test        |   34 -------
 tests/cdemo-shared-exec.test |    3 -
 tests/cdemo-shared-make.test |    3 -
 tests/cdemo-shared.test      |   34 -------
 tests/cdemo-static-exec.test |    3 -
 tests/cdemo-static-make.test |    3 -
 tests/cdemo-static.test      |   34 -------
 tests/cdemo-undef-exec.test  |    3 -
 tests/cdemo-undef-make.test  |    3 -
 tests/cdemo-undef.test       |   49 ----------
 tests/cdemo.at               |  201 ++++++++++++++++++++++++++++++++++++++++++
 tests/cdemo/.gitignore       |    1 -
 tests/cdemo/Makefile.am      |   53 -----------
 tests/cdemo/README           |    4 -
 tests/cdemo/configure.ac     |   63 -------------
 tests/cdemo/foo.c            |   42 ---------
 tests/cdemo/foo.h            |   37 --------
 tests/cdemo/main.c           |   45 ----------
 22 files changed, 205 insertions(+), 509 deletions(-)
 delete mode 100755 tests/cdemo-conf.test
 delete mode 100755 tests/cdemo-exec.test
 delete mode 100755 tests/cdemo-make.test
 delete mode 100755 tests/cdemo-shared-exec.test
 delete mode 100755 tests/cdemo-shared-make.test
 delete mode 100755 tests/cdemo-shared.test
 delete mode 100755 tests/cdemo-static-exec.test
 delete mode 100755 tests/cdemo-static-make.test
 delete mode 100755 tests/cdemo-static.test
 delete mode 100755 tests/cdemo-undef-exec.test
 delete mode 100755 tests/cdemo-undef-make.test
 delete mode 100755 tests/cdemo-undef.test
 create mode 100644 tests/cdemo.at
 delete mode 100644 tests/cdemo/.gitignore
 delete mode 100644 tests/cdemo/Makefile.am
 delete mode 100644 tests/cdemo/README
 delete mode 100644 tests/cdemo/configure.ac
 delete mode 100644 tests/cdemo/foo.c
 delete mode 100644 tests/cdemo/foo.h
 delete mode 100644 tests/cdemo/main.c

diff --git a/Makefile.am b/Makefile.am
index c55dfdd..77941ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -630,13 +630,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 \
@@ -876,9 +877,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 \
@@ -894,9 +892,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 \
@@ -937,17 +932,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.
@@ -967,18 +956,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
diff --git a/configure.ac b/configure.ac
index 0fe1802..8b27629 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
index 4869730..0000000
--- a/tests/cdemo-conf.test
+++ /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
index dce62f2..0000000
--- a/tests/cdemo-exec.test
+++ /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
index 08e70a5..0000000
--- a/tests/cdemo-make.test
+++ /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
index c784065..0000000
--- a/tests/cdemo-shared-exec.test
+++ /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
index 254b3d4..0000000
--- a/tests/cdemo-shared-make.test
+++ /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
index 2d58bd3..0000000
--- a/tests/cdemo-shared.test
+++ /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
index c784065..0000000
--- a/tests/cdemo-static-exec.test
+++ /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
index 254b3d4..0000000
--- a/tests/cdemo-static-make.test
+++ /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
index 36ac2c5..0000000
--- a/tests/cdemo-static.test
+++ /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
index c784065..0000000
--- a/tests/cdemo-undef-exec.test
+++ /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
index 254b3d4..0000000
--- a/tests/cdemo-undef-make.test
+++ /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
index 732e355..0000000
--- a/tests/cdemo-undef.test
+++ /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
index 0000000..f1fef0b
--- /dev/null
+++ b/tests/cdemo.at
@@ -0,0 +1,201 @@
+# 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_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 "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;
+}
+]])
+
+AT_DATA([main.c],
+[[#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;
+}
+]])
+
+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_BOOTSTRAP([], [-I m4], [ignore], [--add-missing], [], 
[--disable-shared], [])
+
+AT_CHECK([grep -E "^build_old_libs=yes" libtool], 0, [ignore])
+AT_CHECK([grep -E "^build_libtool_libs=no" libtool], 0, [ignore])
+
+LT_AT_EXEC_CHECK([./cdemo], 0, [expout])
+
+AT_CLEANUP
+
+
+## ------------- ##
+## Cdemo shared. ##
+## ------------- ##
+
+AT_SETUP([build and link against a dynamic library])
+
+_LT_SETUP
+
+LT_AT_BOOTSTRAP([], [-I m4], [ignore], [--add-missing], [], 
[--disable-static], [])
+
+AT_CHECK([grep -E "^build_old_libs=no" libtool], 0, [ignore])
+AT_CHECK([grep -E "^build_libtool_libs=yes" libtool], 0, [ignore])
+
+LT_AT_EXEC_CHECK([./cdemo], 0, [expout])
+
+AT_CLEANUP
+
+
+## ----------- ##
+## Cdemo conf. ##
+## ----------- ##
+
+AT_SETUP([build both static and dynamic])
+
+_LT_SETUP
+
+LT_AT_BOOTSTRAP([], [-I m4], [ignore], [--add-missing], [], [], [])
+
+AT_CHECK([grep -E "^build_old_libs=yes" libtool], 0, [ignore])
+AT_CHECK([grep -E "^build_libtool_libs=yes" libtool], 0, [ignore])
+
+LT_AT_EXEC_CHECK([./cdemo], 0, [expout])
+
+AT_CLEANUP
+
+
+## ------------ ##
+## Cdemo undef. ##
+## ------------ ##
+
+AT_SETUP([allow_undefined_flag])
+
+_LT_SETUP
+
+LT_AT_BOOTSTRAP([], [-I m4], [ignore], [--add-missing], [], 
[--disable-static], [ignore])
+
+AT_CHECK([grep -E "^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_MAKE
+
+LT_AT_EXEC_CHECK([./cdemo], 0, [expout])
+
+AT_CLEANUP
diff --git a/tests/cdemo/.gitignore b/tests/cdemo/.gitignore
deleted file mode 100644
index f8d8b0e..0000000
--- a/tests/cdemo/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/cdemo
diff --git a/tests/cdemo/Makefile.am b/tests/cdemo/Makefile.am
deleted file mode 100644
index 148ca53..0000000
--- a/tests/cdemo/Makefile.am
+++ /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
index fd3e418..0000000
--- a/tests/cdemo/README
+++ /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
index e008f72..0000000
--- a/tests/cdemo/configure.ac
+++ /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], address@hidden)
-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
index b522fec..0000000
--- a/tests/cdemo/foo.c
+++ /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
index ae66563..0000000
--- a/tests/cdemo/foo.h
+++ /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
index aef8bf0..0000000
--- a/tests/cdemo/main.c
+++ /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;
-}
-- 
1.7.7.4

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]