libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 07/10] tests: migrate legacy tests/mdemo2 tests to Autotest.


From: Gary V. Vaughan
Subject: [PATCH 07/10] tests: migrate legacy tests/mdemo2 tests to Autotest.
Date: Fri, 25 Nov 2011 16:10:58 +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 <address@hidden>
---
 Makefile.am               |    9 +----
 configure.ac              |    3 +-
 tests/mdemo.at            |   83 +++++++++++++++++++++++++++++++++++++++++++++
 tests/mdemo2-conf.test    |   34 ------------------
 tests/mdemo2-exec.test    |   35 -------------------
 tests/mdemo2-make.test    |   35 -------------------
 tests/mdemo2/.gitignore   |    2 -
 tests/mdemo2/Makefile.am  |   53 ----------------------------
 tests/mdemo2/README       |    4 --
 tests/mdemo2/configure.ac |   62 ---------------------------------
 tests/mdemo2/main.c       |   46 -------------------------
 11 files changed, 85 insertions(+), 281 deletions(-)
 delete mode 100755 tests/mdemo2-conf.test
 delete mode 100755 tests/mdemo2-exec.test
 delete mode 100755 tests/mdemo2-make.test
 delete mode 100644 tests/mdemo2/.gitignore
 delete mode 100644 tests/mdemo2/Makefile.am
 delete mode 100644 tests/mdemo2/README
 delete mode 100644 tests/mdemo2/configure.ac
 delete mode 100644 tests/mdemo2/main.c

diff --git a/Makefile.am b/Makefile.am
index fe21b6e..2f9b90b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -854,14 +854,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 f031fb6..fe76f2d 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 d1ece9f..12c762d 100644
--- a/tests/mdemo.at
+++ b/tests/mdemo.at
@@ -103,6 +103,12 @@ mdemo_static_DEPENDENCIES = $(mdemo_DEPENDENCIES)
 
 libtool: $(LIBTOOL_DEPS)
        $(SHELL) ./config.status --recheck
+
+include $(srcdir)/mdemo.mk
+]])
+
+AT_DATA([mdemo.mk],
+[[# Don't abort for lack of mdemo.mk
 ]])
 
 AT_DATA([foo.h],
@@ -780,3 +786,80 @@ force_dry_run=false
 _LT_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_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 e399997..0000000
--- 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 672df93..0000000
--- 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 8f5e4dc..0000000
--- 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 44b759d..0000000
--- 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 3b2beb1..0000000
--- 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 a808876..0000000
--- 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 b25e455..0000000
--- 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], 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([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 a08d968..0000000
--- 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;
-}
-- 
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]