summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2011-11-24 15:49:07 +0700
committerGary V. Vaughan <gary@gnu.org>2012-10-04 20:11:05 +0700
commit233829c0b5c3e822398222d4a2f6ea67f61790cf (patch)
tree63354df1cc110716bdd144741ee34e3bce424ed3
parentd7cdd528f9889e3c5c36591a5e4c847ca37cb50b (diff)
downloadlibtool-233829c0b5c3e822398222d4a2f6ea67f61790cf.tar.gz
tests: migrate legacy tests/mdemo2 tests to Autotest.
This test was just a small non-ltdl aware library to load a library from the legacy mdemo test, which in turn used ltdl to call functions from modules. No need to create a whole other test group with copies of everything from mdemo setup - just tack the additional test on the end of the mdemo group. * tests/mdemo.at (link with library that loads ltdl modules): New test, based on... * tests/mdemo2-conf.test, tests/mdemo-exec.test, tests/mdemo-make.test: ...these legacy tests, now removed. * tests/mdemo2/Makefile.am, tests/mdemo2/README, tests/mdemo2/configure.ac, tests/mdemo2/main.c: Remove. * configure.ac (CONF_SUBDIRS): Remove tests/mdemo2. * Makefile.am: Adjust. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
-rw-r--r--Makefile.am9
-rw-r--r--configure.ac3
-rw-r--r--tests/mdemo.at77
-rwxr-xr-xtests/mdemo2-conf.test34
-rwxr-xr-xtests/mdemo2-exec.test35
-rwxr-xr-xtests/mdemo2-make.test35
-rw-r--r--tests/mdemo2/.gitignore2
-rw-r--r--tests/mdemo2/Makefile.am53
-rw-r--r--tests/mdemo2/README4
-rw-r--r--tests/mdemo2/configure.ac62
-rw-r--r--tests/mdemo2/main.c46
11 files changed, 79 insertions, 281 deletions
diff --git a/Makefile.am b/Makefile.am
index 0d7ef0b9..b35253b1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -850,14 +850,7 @@ COMMON_TESTS = \
tests/objectlist.test \
tests/quote.test \
tests/suffix.test \
- tests/tagtrace.test \
- tests/mdemo2-conf.test \
- tests/mdemo2-make.test \
- tests/mdemo2-exec.test
-
-tests/mdemo2-exec.log: tests/mdemo2-make.log
-tests/mdemo2-make.log: tests/mdemo2-conf.log \
- tests/mdemo-dryrun.log
+ tests/tagtrace.test
INTERACTIVE_TESTS =
NONINTERACTIVE_TESTS = $(COMMON_TESTS)
diff --git a/configure.ac b/configure.ac
index 7a4099bb..0c7aba5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,8 +126,7 @@ AC_SUBST([pkgaux_scripts])
# All subdirectories that are configured on demand, but that must be
# included in the distribution.
-CONF_SUBDIRS="tests/f77demo tests/fcdemo \
- tests/mdemo2"
+CONF_SUBDIRS="tests/f77demo tests/fcdemo"
AC_SUBST([CONF_SUBDIRS])
DIST_MAKEFILE_LIST=
diff --git a/tests/mdemo.at b/tests/mdemo.at
index 30721495..8497ae82 100644
--- a/tests/mdemo.at
+++ b/tests/mdemo.at
@@ -783,3 +783,80 @@ force_dry_run=false
LT_AT_CHECK_UNINSTALL
AT_CLEANUP
+
+## ------- ##
+## Mdemo2. ##
+## ------- ##
+
+AT_SETUP([link with library that loads ltdl modules])
+
+_LT_SETUP
+
+AT_DATA([mdemo.mk],
+[[bin_PROGRAMS += mdemo2 mdemo2_static
+
+# Create a version of mdemo2 that links a library that does dlopen.
+mdemo2_LDFLAGS = -export-dynamic "-dlopen" force
+mdemo2_LDADD = libmlib.la
+
+# Create a statically linked version of mdemo.
+mdemo2_static_SOURCES = mdemo2.c
+mdemo2_static_LDFLAGS = $(STATIC) $(mdemo2_LDFLAGS)
+mdemo2_static_LDADD = $(mdemo2_LDADD)
+mdemo2_static_DEPENDENCIES = $(mdemo2_DEPENDENCIES)
+]])
+
+AT_DATA([mdemo2.c],
+[[#include <stdio.h>
+#include "ltdl.h"
+
+extern int mlib_func (int, char **);
+
+int main (int argc, char **argv)
+{
+ int ret = 0;
+
+ printf ("Welcome to GNU libtool mdemo2!\n");
+ if (argc < 2) {
+ fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
+ }
+
+ /* This must be called in the program to get the preloaded symbols */
+ LTDL_SET_PRELOADED_SYMBOLS();
+
+ ret = mlib_func(argc, argv);
+
+ return ret;
+}
+]])
+
+AT_DATA([expout],
+[[Welcome to GNU libtool mdemo2!
+module name: foo1
+module reference count: 1
+** This is foolib 1 **
+hello returned: 57616
+hello is ok!
+cos (0.0) = 1
+sub() called
+foo1 is ok!
+module name: libfoo2
+module reference count: 1
+** This is foolib 2 **
+hello returned: 57616
+hello is ok!
+sin (0.0) = 0
+sub() called
+foo2 is ok!
+]])
+
+LT_AT_CHECK_CONFIG
+
+LT_AT_MAKE
+
+LT_AT_EXEC_CHECK([./mdemo2_static], 0, [expout], [],
+ [./foo1.la ./libfoo2.la | $EGREP -v '^module filename: '])
+LT_AT_EXEC_CHECK([./mdemo2], 0, [expout], [],
+ [./foo1.la ./libfoo2.la | $EGREP -v '^module filename: '])
+
+AT_CLEANUP
diff --git a/tests/mdemo2-conf.test b/tests/mdemo2-conf.test
deleted file mode 100755
index e399997b..00000000
--- a/tests/mdemo2-conf.test
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# mdemo2-conf.test - try configuring the mdemo2 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/mdemo2"
-func_make_distclean
-func_configure
-func_check_static_shared "yes" "yes"
-
-exit 0
diff --git a/tests/mdemo2-exec.test b/tests/mdemo2-exec.test
deleted file mode 100755
index 672df93c..00000000
--- a/tests/mdemo2-exec.test
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-# mdemo2-exec.test - check that programs in the mdemo2 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 "mdemo2-make" "tests/mdemo2/mdemo2$EXEEXT"
-
-func_rmprefixdir
-func_exec_init "uninstalled"
-func_exec "tests/mdemo2/mdemo2_static$EXEEXT tests/mdemo/foo1.la tests/mdemo/libfoo2.la"
-func_exec "tests/mdemo2/mdemo2$EXEEXT tests/mdemo/foo1.la tests/mdemo/libfoo2.la"
-
-exit $exec_status
diff --git a/tests/mdemo2-make.test b/tests/mdemo2-make.test
deleted file mode 100755
index 8f5e4dcb..00000000
--- a/tests/mdemo2-make.test
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-# mdemo2-make.test - try building in the mdemo2 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 "mdemo2-conf" "tests/mdemo2/Makefile"
-func_require "mdemo-make" "tests/mdemo/libmlib.la"
-
-func_rmprefixdir
-func_cd "tests/mdemo2"
-func_make
-
-exit 0
diff --git a/tests/mdemo2/.gitignore b/tests/mdemo2/.gitignore
deleted file mode 100644
index 44b759d7..00000000
--- a/tests/mdemo2/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/mdemo2
-/mdemo2_static
diff --git a/tests/mdemo2/Makefile.am b/tests/mdemo2/Makefile.am
deleted file mode 100644
index 3b2beb12..00000000
--- a/tests/mdemo2/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)/../.. -I$(top_srcdir)/../../libltdl
-
-bin_PROGRAMS = mdemo2 mdemo2_static
-
-# Create a version of mdemo2 that links a library that does dlopen.
-mdemo2_SOURCES = main.c
-mdemo2_LDFLAGS = -export-dynamic "-dlopen" force
-mdemo2_LDADD = ../mdemo/libmlib.la
-
-# Create a statically linked version of mdemo.
-mdemo2_static_SOURCES = $(mdemo2_SOURCES)
-mdemo2_static_LDFLAGS = $(STATIC) $(mdemo2_LDFLAGS)
-mdemo2_static_LDADD = $(mdemo2_LDADD)
-mdemo2_static_DEPENDENCIES = $(mdemo2_DEPENDENCIES)
-
-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/mdemo2/README b/tests/mdemo2/README
deleted file mode 100644
index a8088763..00000000
--- a/tests/mdemo2/README
+++ /dev/null
@@ -1,4 +0,0 @@
-This is mdemo2, an example package that attempts to use GNU libtool to
-link with a library that itself does dlopening of libtool modules.
-
-This demo depends upon the libraries generated in ../mdemo.
diff --git a/tests/mdemo2/configure.ac b/tests/mdemo2/configure.ac
deleted file mode 100644
index b25e4555..00000000
--- a/tests/mdemo2/configure.ac
+++ /dev/null
@@ -1,62 +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([mdemo2], [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([dlopen])
-AC_SUBST(LIBTOOL_DEPS)
-
-STATIC=
-test yes = "$enable_static" && STATIC="-static"
-AC_SUBST([STATIC])
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/tests/mdemo2/main.c b/tests/mdemo2/main.c
deleted file mode 100644
index a08d9681..00000000
--- a/tests/mdemo2/main.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* main.c -- mdemo2 test program
-
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
- Written by Greg Eisenhauer, 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.
-*/
-
-#include <stdio.h>
-#include "ltdl.h"
-
-extern int mlib_func (int, char **);
-
-int
-main (int argc, char **argv)
-{
- int ret = 0;
-
- printf ("Welcome to GNU libtool mdemo2!\n");
- if (argc < 2) {
- fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
- }
-
-/* This must be called in the program to get the preloaded symbols */
- LTDL_SET_PRELOADED_SYMBOLS();
-
- ret = mlib_func(argc, argv);
-
- return ret;
-}