]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
tests: migrate legacy tests/mdemo2 tests to Autotest.
authorGary V. Vaughan <gary@gnu.org>
Thu, 24 Nov 2011 08:49:07 +0000 (15:49 +0700)
committerGary V. Vaughan <gary@gnu.org>
Thu, 4 Oct 2012 13:11:05 +0000 (20:11 +0700)
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>
Makefile.am
configure.ac
tests/mdemo.at
tests/mdemo2-conf.test [deleted file]
tests/mdemo2-exec.test [deleted file]
tests/mdemo2-make.test [deleted file]
tests/mdemo2/.gitignore [deleted file]
tests/mdemo2/Makefile.am [deleted file]
tests/mdemo2/README [deleted file]
tests/mdemo2/configure.ac [deleted file]
tests/mdemo2/main.c [deleted file]

index 0d7ef0b9e373e964afe2a88a844bcec24c8df246..b35253b129567705792788f6b793c67729208675 100644 (file)
@@ -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)
index 7a4099bbed0691ca21e9c531c74c954f5878b99e..0c7aba5a71191c323932d46a91714401b6101836 100644 (file)
@@ -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=
index 30721495c73d105e336f8e51b3cfa924f9bba3f2..8497ae8266d39b59a0d436aca0e3c726d7a2e550 100644 (file)
@@ -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 (executable)
index e399997..0000000
+++ /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 (executable)
index 672df93..0000000
+++ /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 (executable)
index 8f5e4dc..0000000
+++ /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 (file)
index 44b759d..0000000
+++ /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 (file)
index 3b2beb1..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)/../.. -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 (file)
index a808876..0000000
+++ /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 (file)
index b25e455..0000000
+++ /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 (file)
index a08d968..0000000
+++ /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;
-}