libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 06/10] tests: migrate legacy tests/mdemo tests to Autotest.


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

* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 Makefile.am                  |   37 +--
 configure.ac                 |    2 +-
 tests/mdemo-conf.test        |   34 --
 tests/mdemo-dryrun.test      |  116 -------
 tests/mdemo-exec.test        |   39 --
 tests/mdemo-inst.test        |   37 --
 tests/mdemo-make.test        |   34 --
 tests/mdemo-shared-exec.test |    3 -
 tests/mdemo-shared-inst.test |    3 -
 tests/mdemo-shared-make.test |    3 -
 tests/mdemo-shared-unst.test |    3 -
 tests/mdemo-shared.test      |   34 --
 tests/mdemo-static-exec.test |    3 -
 tests/mdemo-static-inst.test |    3 -
 tests/mdemo-static-make.test |    3 -
 tests/mdemo-static-unst.test |    3 -
 tests/mdemo-static.test      |   34 --
 tests/mdemo-unst.test        |   34 --
 tests/mdemo.at               |  782 ++++++++++++++++++++++++++++++++++++++++++
 tests/mdemo/.gitignore       |    2 -
 tests/mdemo/Makefile.am      |   87 -----
 tests/mdemo/README           |   16 -
 tests/mdemo/configure.ac     |   72 ----
 tests/mdemo/foo.h            |   48 ---
 tests/mdemo/foo1.c           |   61 ----
 tests/mdemo/foo2.c           |   61 ----
 tests/mdemo/main.c           |  254 --------------
 tests/mdemo/mlib.c           |  136 --------
 tests/mdemo/sub.c            |   31 --
 29 files changed, 785 insertions(+), 1190 deletions(-)
 delete mode 100755 tests/mdemo-conf.test
 delete mode 100755 tests/mdemo-dryrun.test
 delete mode 100755 tests/mdemo-exec.test
 delete mode 100755 tests/mdemo-inst.test
 delete mode 100755 tests/mdemo-make.test
 delete mode 100755 tests/mdemo-shared-exec.test
 delete mode 100755 tests/mdemo-shared-inst.test
 delete mode 100755 tests/mdemo-shared-make.test
 delete mode 100755 tests/mdemo-shared-unst.test
 delete mode 100755 tests/mdemo-shared.test
 delete mode 100755 tests/mdemo-static-exec.test
 delete mode 100755 tests/mdemo-static-inst.test
 delete mode 100755 tests/mdemo-static-make.test
 delete mode 100755 tests/mdemo-static-unst.test
 delete mode 100755 tests/mdemo-static.test
 delete mode 100755 tests/mdemo-unst.test
 create mode 100644 tests/mdemo.at
 delete mode 100644 tests/mdemo/.gitignore
 delete mode 100644 tests/mdemo/Makefile.am
 delete mode 100644 tests/mdemo/README
 delete mode 100644 tests/mdemo/configure.ac
 delete mode 100644 tests/mdemo/foo.h
 delete mode 100644 tests/mdemo/foo1.c
 delete mode 100644 tests/mdemo/foo2.c
 delete mode 100644 tests/mdemo/main.c
 delete mode 100644 tests/mdemo/mlib.c
 delete mode 100644 tests/mdemo/sub.c

diff --git a/Makefile.am b/Makefile.am
index 4279389..fe21b6e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -677,6 +677,7 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/resident.at \
                  tests/slist.at \
                  tests/need_lib_prefix.at \
+                 tests/mdemo.at \
                  tests/standalone.at \
                  tests/subproject.at \
                  tests/nonrecursive.at \
@@ -854,43 +855,9 @@ COMMON_TESTS = \
        tests/quote.test \
        tests/suffix.test \
        tests/tagtrace.test \
-       tests/mdemo-static.test \
-       tests/mdemo-static-make.test \
-       tests/mdemo-static-exec.test \
-       tests/mdemo-static-inst.test \
-       tests/mdemo-static-unst.test \
-       tests/mdemo-conf.test \
-       tests/mdemo-make.test \
-       tests/mdemo-exec.test \
-       tests/mdemo-inst.test \
-       tests/mdemo-unst.test \
-       tests/mdemo-dryrun.test \
        tests/mdemo2-conf.test \
        tests/mdemo2-make.test \
-       tests/mdemo2-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/mdemo-shared-unst.log:   tests/mdemo-shared-inst.log
-tests/mdemo-shared-inst.log:   tests/mdemo-shared-exec.log
-tests/mdemo-shared-exec.log:   tests/mdemo-shared-make.log
-tests/mdemo-shared-make.log:   tests/mdemo-shared.log
-tests/mdemo-shared.log: $(ORDER) tests/mdemo-dryrun.log \
-                               tests/mdemo2-exec.log
-
-tests/mdemo-dryrun.log:                tests/mdemo-unst.log
-tests/mdemo-unst.log:          tests/mdemo-inst.log
-tests/mdemo-inst.log:          tests/mdemo-exec.log
-tests/mdemo-exec.log:          tests/mdemo-make.log
-tests/mdemo-make.log:          tests/mdemo-conf.log
-tests/mdemo-conf.log: $(ORDER) tests/mdemo-static-unst.log
-tests/mdemo-static-unst.log:   tests/mdemo-static-inst.log
-tests/mdemo-static-inst.log:   tests/mdemo-static-exec.log
-tests/mdemo-static-exec.log:   tests/mdemo-static-make.log
-tests/mdemo-static-make.log:   tests/mdemo-static.log
+       tests/mdemo2-exec.test
 
 tests/mdemo2-exec.log:         tests/mdemo2-make.log
 tests/mdemo2-make.log:         tests/mdemo2-conf.log \
diff --git a/configure.ac b/configure.ac
index d3908c8..f031fb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,7 +127,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/mdemo tests/mdemo2"
+       tests/mdemo2"
 AC_SUBST([CONF_SUBDIRS])
 
 DIST_MAKEFILE_LIST=
diff --git a/tests/mdemo-conf.test b/tests/mdemo-conf.test
deleted file mode 100755
index 5742af0..0000000
--- a/tests/mdemo-conf.test
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# mdemo-conf.test - try configuring the mdemo 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/mdemo"
-func_make_distclean
-func_configure
-func_check_static_shared "yes" "yes"
-
-exit 0
diff --git a/tests/mdemo-dryrun.test b/tests/mdemo-dryrun.test
deleted file mode 100755
index 678891d..0000000
--- a/tests/mdemo-dryrun.test
+++ /dev/null
@@ -1,116 +0,0 @@
-#! /bin/sh
-# mdemo-dryrun.test - check whether the --dry-run mode works properly
-#
-#   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 "mdemo-conf" "tests/mdemo/Makefile"
-
-func_mkprefixdir
-func_cd "tests/mdemo"
-func_make "clean"
-
-# create `before' and `after' in a directory deep within objdir,
-# so that their creation and removal does not modify even a timestamp
-# in the output of `ls -l . $objdir'
-func_mkdir_p "$objdir/temp/temp"
-before=$objdir/temp/temp/before
-after=$objdir/temp/temp/after
-
-# Create a new libtool script that will enter dry run if the environment
-# variable force_dry_run is set
-rm -f $objdir/libtool.new
-sed 's/^opt_dry_run=.*$/opt_dry_run=${force_dry_run-false}/' < libtool > 
$objdir/libtool.new
-chmod +x $objdir/libtool.new
-mv libtool $objdir/libtool
-mv $objdir/libtool.new libtool
-
-# main.o is not compiled with libtool, but it depends on it, so make
-# sure it is up-to-date.  libfoo2.la is linked with libsub.la, so make
-# sure it exists, otherwise libtool will complain.
-func_make main.$objext
-
-func_msg "Making object files in mdemo (dry run)"
-# ls -l in MSYS sometimes shows year, not time, for really fresh files.
-sleep 1
-ls -l . $objdir | grep -v total > $before
-force_dry_run=: $MAKE foo1.lo foo2.lo sub.lo || exit $?
-ls -l . $objdir | grep -v total > $after
-cmp $before $after > /dev/null || exit 1
-# Now really make them
-func_make foo1.lo foo2.lo libsub.la
-
-func_msg "Making libraries in mdemo (dry run)"
-# ls -l in MSYS sometimes shows year, not time, for really fresh files.
-sleep 1
-ls -l . $objdir | grep -v total > $before
-force_dry_run=: $MAKE foo1.la libfoo2.la || exit $?
-ls -l . $objdir | grep -v total > $after
-cmp $before $after > /dev/null || exit 1
-# Now really make them
-func_make foo1.la libfoo2.la
-
-func_msg "Making programs in ../mdemo (dry run)"
-# ls -l in MSYS sometimes shows year, not time, for really fresh files.
-sleep 1
-ls -l . $objdir | grep -v total > $before
-force_dry_run=: $MAKE mdemo$EXEEXT mdemo_static$EXEEXT 1>&2 || exit $?
-ls -l . $objdir | grep -v total > $after
-cmp $before $after > /dev/null || exit 1
-# Now really make them
-func_make mdemo$EXEEXT mdemo_static$EXEEXT
-
-func_msg "Running $MAKE install in ../mdemo (dry run)"
-# Libtool does not create these directories
-func_mkdir_p "$prefix/bin"
-func_mkdir_p "$prefix/lib"
-# ls -l in MSYS sometimes shows year, not time, for really fresh files.
-sleep 1
-ls -l . $objdir | grep -v total > $before
-ls -lR $prefix | grep -v total >> $before
-force_dry_run=: $MAKE install 1>&2 || exit 1
-ls -l . $objdir | grep -v total > $after
-ls -lR $prefix | grep -v total >> $after
-cmp $before $after > /dev/null || exit 1
-# Now really run it
-func_make install
-
-func_msg "Running $MAKE uninstall in ../mdemo (dry run)"
-# Libtool does not uninstall the programs, remove them first
-rm -f "$prefix/bin/mdemo$EXEEXT" "$prefix/bin/mdemo_static$EXEEXT"
-# ls -l in MSYS sometimes shows year, not time, for really fresh files.
-sleep 1
-ls -l . $objdir | grep -v total > $before
-ls -lR $prefix | grep -v total >> $before
-force_dry_run=: $MAKE uninstall 1>&2 || exit $?
-ls -l . $objdir | grep -v total > $after
-ls -lR $prefix | grep -v total >> $after
-cmp $before $after > /dev/null || exit 1
-# Now really run it
-func_make uninstall
-
-rm -f $before $after libtool
-mv $objdir/libtool libtool
-
-exit 0
diff --git a/tests/mdemo-exec.test b/tests/mdemo-exec.test
deleted file mode 100755
index ee3014e..0000000
--- a/tests/mdemo-exec.test
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh
-# mdemo-exec.test - check that programs in the mdemo subdirectory are viable
-#
-#   Copyright (C) 2003, 2004, 2005, 2007 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 "mdemo-make" "tests/mdemo/mdemo$EXEEXT"
-
-func_rmprefixdir
-func_exec_init "uninstalled"
-func_exec "tests/mdemo/mdemo_static$EXEEXT tests/mdemo/foo1.la 
tests/mdemo/libfoo2.la" \
-         "try_iterate: .*libfoo2"
-func_exec "tests/mdemo/mdemo$EXEEXT tests/mdemo/foo1.la 
tests/mdemo/libfoo2.la" \
-         "try_iterate: .*libfoo2"
-func_exec "tests/mdemo/mdemo_static$EXEEXT `pwd`/tests/mdemo/foo1.la 
`pwd`/tests/mdemo/libfoo2.la"
-func_exec "tests/mdemo/mdemo$EXEEXT `pwd`/tests/mdemo/foo1.la 
`pwd`/tests/mdemo/libfoo2.la"
-
-exit $exec_status
diff --git a/tests/mdemo-inst.test b/tests/mdemo-inst.test
deleted file mode 100755
index d611836..0000000
--- a/tests/mdemo-inst.test
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-# mdemo-inst.test - try installing from the mdemo 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 "mdemo-make" "tests/mdemo/mdemo$EXEEXT"
-
-func_mkprefixdir
-func_cd "tests/mdemo"
-func_make "install"
-func_exec_init "installed"
-func_exec "$prefix/bin/mdemo_static$EXEEXT $prefix/lib/foo1.la 
$prefix/lib/libfoo2.la"
-func_exec "$prefix/bin/mdemo$EXEEXT $prefix/lib/foo1.la $prefix/lib/libfoo2.la"
-
-exit $status
diff --git a/tests/mdemo-make.test b/tests/mdemo-make.test
deleted file mode 100755
index 29c4cd4..0000000
--- a/tests/mdemo-make.test
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# mdemo-make.test - try building in the mdemo 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 "mdemo-conf" "tests/mdemo/Makefile"
-
-func_rmprefixdir
-func_cd "tests/mdemo"
-func_make
-
-exit 0
diff --git a/tests/mdemo-shared-exec.test b/tests/mdemo-shared-exec.test
deleted file mode 100755
index 17240b0..0000000
--- a/tests/mdemo-shared-exec.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/mdemo-exec.test
diff --git a/tests/mdemo-shared-inst.test b/tests/mdemo-shared-inst.test
deleted file mode 100755
index 7b8f7a6..0000000
--- a/tests/mdemo-shared-inst.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/mdemo-inst.test
diff --git a/tests/mdemo-shared-make.test b/tests/mdemo-shared-make.test
deleted file mode 100755
index ef661d8..0000000
--- a/tests/mdemo-shared-make.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/mdemo-make.test
diff --git a/tests/mdemo-shared-unst.test b/tests/mdemo-shared-unst.test
deleted file mode 100755
index 100ab8e..0000000
--- a/tests/mdemo-shared-unst.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/mdemo-unst.test
diff --git a/tests/mdemo-shared.test b/tests/mdemo-shared.test
deleted file mode 100755
index fb32764..0000000
--- a/tests/mdemo-shared.test
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# mdemo-shared.test - try configuring the mdemo 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/mdemo"
-func_make_distclean
-func_configure "--disable-static"
-func_check_static_shared "no" "yes"
-
-exit 0
diff --git a/tests/mdemo-static-exec.test b/tests/mdemo-static-exec.test
deleted file mode 100755
index 17240b0..0000000
--- a/tests/mdemo-static-exec.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/mdemo-exec.test
diff --git a/tests/mdemo-static-inst.test b/tests/mdemo-static-inst.test
deleted file mode 100755
index 7b8f7a6..0000000
--- a/tests/mdemo-static-inst.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/mdemo-inst.test
diff --git a/tests/mdemo-static-make.test b/tests/mdemo-static-make.test
deleted file mode 100755
index ef661d8..0000000
--- a/tests/mdemo-static-make.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/mdemo-make.test
diff --git a/tests/mdemo-static-unst.test b/tests/mdemo-static-unst.test
deleted file mode 100755
index 100ab8e..0000000
--- a/tests/mdemo-static-unst.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/mdemo-unst.test
diff --git a/tests/mdemo-static.test b/tests/mdemo-static.test
deleted file mode 100755
index 5df535d..0000000
--- a/tests/mdemo-static.test
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# mdemo-static.test - try configuring the mdemo 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/mdemo"
-func_make_distclean
-func_configure "--disable-shared"
-func_check_static_shared "yes" "no"
-
-exit 0
diff --git a/tests/mdemo-unst.test b/tests/mdemo-unst.test
deleted file mode 100755
index e808e31..0000000
--- a/tests/mdemo-unst.test
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# mdemo-unst.test - try uninstalling in the mdemo 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 "mdemo-inst" "$prefix/bin/mdemo$EXEEXT" "tests/mdemo/Makefile"
-
-func_mkprefixdir
-func_cd "tests/mdemo"
-func_make_uninstall
-
-exit 0
diff --git a/tests/mdemo.at b/tests/mdemo.at
new file mode 100644
index 0000000..d1ece9f
--- /dev/null
+++ b/tests/mdemo.at
@@ -0,0 +1,782 @@
+# cdemo.at -- Using Automake to build a program and library -*- Autotest -*-
+#
+#   Copyright (C) 1998, 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
+#   Written by Thomas Tanner, 1998
+#   Written by Greg Eisenhauer, 2002
+#   Rewritten 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([Dynamic ltdl runtime loading.])
+
+# _LT_SETUP
+# ---------
+m4_define([_LT_SETUP],
+[AT_DATA([configure.ac],
+[[AC_INIT([mdemo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+LTDL_CONVENIENCE([../../../libltdl])
+AC_SUBST([INCLTDL])
+AC_SUBST([LIBLTDL])
+LT_INIT([dlopen win32-dll])
+AC_SUBST([LIBTOOL_DEPS])
+STATIC=
+test yes = "$enable_static" && STATIC=-static
+AC_SUBST([STATIC])
+LT_LIB_M
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.am],
+[[AUTOMAKE_OPTIONS = no-dependencies foreign
+ACLOCAL_AMFLAGS = -I m4
+AM_CPPFLAGS = -I$(top_srcdir)/../../.. $(INCLTDL)
+
+lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la libmlib.la
+
+foo1_la_SOURCES = foo1.c
+foo1_la_LIBADD = $(LIBM) libsub.la
+foo1_la_LDFLAGS = -no-undefined -module -avoid-version
+
+libfoo2_la_SOURCES = foo2.c
+libfoo2_la_LIBADD = $(LIBM) libsub.la
+libfoo2_la_LDFLAGS = -no-undefined -module -export-symbols-regex "libfoo2.*"
+
+libsub_la_SOURCES = sub.c
+libsub_la_LDFLAGS = -no-undefined
+
+## Use -export-symbols-regex here explicitly because libltdl marks
+## its exported symbols, and we use libltdl as a convenience archive.
+## Thus, on w32, auto-exporting is turned off.
+libmlib_la_SOURCES = mlib.c
+libmlib_la_LIBADD = $(LIBLTDL) "-dlopen" foo1.la "-dlopen" libfoo2.la
+libmlib_la_LDFLAGS = -no-undefined -export-symbols-regex ".*"
+libmlib_la_DEPENDENCIES = $(LIBLTDL) libsub.la foo1.la libfoo2.la
+
+noinst_HEADERS = foo.h
+
+top_distdir = ../../..
+$(LIBLTDL): $(top_distdir)/libtool \
+    $(top_distdir)/config.h $(srcdir)/$(top_distdir)/libltdl/ltdl.c \
+    $(srcdir)/$(top_distdir)/libltdl/ltdl.h
+       (cd $(top_distdir); $(MAKE) `echo $(LIBLTDL) | sed 
's|.*\.\./\.\./libltdl/|libltdl/|g'`)
+# Do not error out if toplevel config.h does not exist:
+$(top_distdir)/config.h:
+
+bin_PROGRAMS = mdemo mdemo_static
+
+# Create a version of mdemo that does dlopen.
+mdemo_SOURCES = main.c
+mdemo_LDFLAGS = -export-dynamic
+## The quotes around -dlopen below fool automake into accepting it
+mdemo_LDADD = $(LIBLTDL) libsub.la "-dlopen" self \
+               "-dlopen" foo1.la "-dlopen" libfoo2.la
+mdemo_DEPENDENCIES = $(LIBLTDL) libsub.la foo1.la libfoo2.la
+
+# Create a statically linked version of mdemo.
+mdemo_static_SOURCES = $(mdemo_SOURCES)
+mdemo_static_LDFLAGS = $(STATIC) $(mdemo_LDFLAGS)
+mdemo_static_LDADD = $(mdemo_LDADD)
+mdemo_static_DEPENDENCIES = $(mdemo_DEPENDENCIES)
+
+libtool: $(LIBTOOL_DEPS)
+       $(SHELL) ./config.status --recheck
+]])
+
+AT_DATA([foo.h],
+[[#ifndef FOO_H
+#define FOO_H
+
+/* Silly constants that the functions return. */
+#define HELLO_RET 0xe110
+#define FOO_RET 0xf00
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int sub (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+]])
+
+AT_DATA([foo1.c],
+[[#include "foo.h"
+#include <stdio.h>
+#include <math.h>
+
+#define nothing foo1_LTX_nothing
+#define foo1    foo1_LTX_foo1
+#define hello   foo1_LTX_hello
+
+/* Give a global variable definition. */
+int nothing = FOO_RET;
+
+/* private function */
+int _foo1_helper (void) {
+  sub ();
+  return FOO_RET;
+}
+
+/* export functions */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int foo1 (void) {
+    printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
+    return _foo1_helper ();
+}
+
+int hello () {
+    printf ("** This is foolib 1 **\n");
+    return HELLO_RET;
+}
+
+#ifdef __cplusplus
+}
+#endif
+]])
+
+AT_DATA([foo2.c],
+[[#include "foo.h"
+#include <stdio.h>
+#include <math.h>
+
+#define nothing libfoo2_LTX_nothing
+#define foo2    libfoo2_LTX_foo2
+#define hello   libfoo2_LTX_hello
+
+/* Give a global variable definition. */
+int nothing;
+
+/* private function */
+int _foo2_helper (void) {
+  sub ();
+  return FOO_RET;
+}
+
+/* export functions */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int foo2 (void) {
+    printf ("sin (0.0) = %g\n", (double) sin ((double) 0.0));
+    return _foo2_helper ();
+}
+
+int hello () {
+    printf ("** This is foolib 2 **\n");
+    return HELLO_RET;
+}
+
+#ifdef __cplusplus
+}
+#endif
+]])
+
+AT_DATA([mlib.c],
+[[#include "foo.h"
+#include "ltdl.h"
+#include <stdio.h>
+
+int test_dl (char *filename) {
+  lt_dlhandle handle;
+  const lt_dlinfo *info;
+  int (*pfoo1)() = 0;
+  int (*pfoo2)() = 0;
+  int (*phello)() = 0;
+  int *pnothing = 0;
+  int ret = 0;
+
+  handle = lt_dlopen(filename);
+  if (!handle) {
+    fprintf (stderr, "can't open the module %s!\n", filename);
+    fprintf (stderr, "error was: %s\n", lt_dlerror());
+    return 1;
+  }
+
+  info = lt_dlgetinfo(handle);
+  if (!info) {
+    fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
+    return 1;
+  }
+  if (info->name) {
+    printf ("module name: %s\n", info->name);
+  } else {
+    printf ("module is not a libtool module\n");
+  }
+  printf ("module filename: %s\n", info->filename);
+  printf ("module reference count: %i\n", info->ref_count);
+
+  phello = (int(*)())lt_dlsym(handle, "hello");
+  if (phello)
+    {
+      int value = (*phello) ();
+
+      printf ("hello returned: %i\n", value);
+      if (value == HELLO_RET)
+        printf("hello is ok!\n");
+    }
+  else
+    {
+      fprintf (stderr, "did not find the `hello' function\n");
+      fprintf (stderr, "error was: %s\n", lt_dlerror());
+      ret = 1;
+    }
+
+  pnothing = (int*)lt_dlsym(handle, "nothing");
+  /* Try assigning to the nothing variable. */
+  if (pnothing)
+    *pnothing = 1;
+  else
+    {
+      fprintf (stderr, "did not find the `nothing' variable\n");
+      fprintf (stderr, "error was: %s\n", lt_dlerror());
+      ret = 1;
+    }
+
+  pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
+  /* Just call the functions and check return values. */
+  if (pfoo1)
+    {
+      if ((*pfoo1) () == FOO_RET)
+        printf("foo1 is ok!\n");
+      else
+       ret = 1;
+    }
+  else {
+    pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
+    if (pfoo2)
+      {
+        if ((*pfoo2) () == FOO_RET)
+          printf("foo2 is ok!\n");
+        else ret = 1;
+      }
+    else
+      {
+        fprintf (stderr, "did not find any of the `foo' functions\n");
+        fprintf (stderr, "error was: %s\n", lt_dlerror());
+        ret = 1;
+      }
+  }
+  lt_dlclose(handle);
+  return ret;
+}
+
+int
+mlib_func (int argc, char **argv)
+{
+  int ret = 0;
+  int i;
+  /*
+   * Would be nice if this somehow worked for libraries, not just executables.
+   * LTDL_SET_PRELOADED_SYMBOLS();
+   */
+  if (lt_dlinit() != 0) {
+    fprintf (stderr, "error during initialization: %s\n", lt_dlerror());
+    return 1;
+  }
+
+  for (i = 1; i < argc; i++)
+    if (test_dl(argv[i]))
+       ret = 1;
+
+  lt_dlexit();
+  return ret;
+}
+]])
+
+AT_DATA([sub.c],
+[[#include <stdio.h>
+void sub (void) { printf ("sub() called\n"); }
+]])
+
+AT_DATA([main.c],
+[[#include "foo.h"
+#include "ltdl.h"
+#include <stdio.h>
+#include <string.h>
+
+#ifdef __cplusplus
+#  define EXPORT extern "C"
+#else
+#  define EXPORT extern
+#endif
+
+EXPORT int myfunc (void);
+
+int
+test_dl (char *filename, int test_ext)
+{
+  lt_dlhandle handle;
+  const lt_dlinfo *info;
+  int (*pfoo1)() = 0;
+  int (*pfoo2)() = 0;
+  int (*phello)() = 0;
+  int *pnothing = 0;
+  int ret = 0;
+
+  if (test_ext)
+    handle = lt_dlopenext (filename);
+  else
+    handle = lt_dlopen (filename);
+
+  if (!handle) {
+    fprintf (stderr, "can't open the module %s!\n", filename);
+    fprintf (stderr, "error was: %s\n", lt_dlerror());
+    return 1;
+  }
+
+  info = lt_dlgetinfo(handle);
+  if (!info) {
+    fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
+    return 1;
+  }
+  if (info->name) {
+    printf ("module name: %s\n", info->name);
+  } else {
+    printf ("module is not a libtool module\n");
+  }
+  printf ("module filename: %s\n", info->filename);
+  printf ("module reference count: %i\n", info->ref_count);
+
+  phello = (int(*)())lt_dlsym(handle, "hello");
+  if (phello)
+    {
+      int value = (*phello) ();
+
+      printf ("hello returned: %i\n", value);
+      if (value == HELLO_RET)
+        printf("hello is ok!\n");
+    }
+  else
+    {
+      fprintf (stderr, "did not find the `hello' function\n");
+      fprintf (stderr, "error was: %s\n", lt_dlerror());
+      ret = 1;
+    }
+
+  pnothing = (int*)lt_dlsym(handle, "nothing");
+  /* Try assigning to the nothing variable. */
+  if (pnothing)
+    *pnothing = 1;
+  else
+    {
+      fprintf (stderr, "did not find the `nothing' variable\n");
+      fprintf (stderr, "error was: %s\n", lt_dlerror());
+      ret = 1;
+    }
+
+  pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
+  /* Just call the functions and check return values. */
+  if (pfoo1)
+    {
+      if ((*pfoo1) () == FOO_RET)
+        printf("foo1 is ok!\n");
+      else
+       ret = 1;
+    }
+  else {
+    pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
+    if (pfoo2)
+      {
+        if ((*pfoo2) () == FOO_RET)
+          printf("foo2 is ok!\n");
+        else ret = 1;
+      }
+    else
+      {
+        fprintf (stderr, "did not find any of the `foo' functions\n");
+        fprintf (stderr, "error was: %s\n", lt_dlerror());
+        ret = 1;
+      }
+  }
+  lt_dlclose(handle);
+  return ret;
+}
+
+int
+myfunc ()
+{
+  return HELLO_RET;
+}
+
+int myvar;
+
+int
+test_dlself ()
+{
+  lt_dlhandle handle;
+  int (*pmyfunc)() = 0;
+  int *pmyvar = 0;
+  int ret = 0;
+
+  handle = lt_dlopen(0);
+  if (!handle) {
+    fprintf (stderr, "can't dlopen the program!\n");
+    fprintf (stderr, "error was: %s\n", lt_dlerror());
+    return 1;
+  }
+
+  pmyfunc = (int(*)())lt_dlsym(handle, "myfunc");
+  if (pmyfunc)
+    {
+      int value = (*pmyfunc) ();
+
+      printf ("myfunc returned: %i\n", value);
+      if (value == HELLO_RET)
+        printf("myfunc is ok!\n");
+    }
+  else
+    {
+      fprintf (stderr, "did not find the `myfunc' function\n");
+      fprintf (stderr, "error was: %s\n", lt_dlerror());
+      ret = 1;
+    }
+
+  pmyvar = (int*)lt_dlsym(handle, "myvar");
+  /* Try assigning to the variable. */
+  if (pmyvar)
+    *pmyvar = 1;
+  else
+    {
+      fprintf (stderr, "did not find the `myvar' variable\n");
+      fprintf (stderr, "error was: %s\n", lt_dlerror());
+      ret = 1;
+    }
+
+  lt_dlclose(handle);
+  return ret;
+}
+
+static int
+callback (const char *filename, void *data)
+{
+  printf ("%s: %s\n", (char *)data, filename);
+  return 0;
+}
+
+static int
+try_iterate (const char *search_path)
+{
+  char *s = "try_iterate";
+  return lt_dlforeachfile (search_path, callback, s);
+}
+
+/* cheap dirname clone.  We require a '/' separator, nonempty and large
+   enough input, not ending with '/', and we will overwrite the input. */
+static char *
+my_dirname (char *path)
+{
+  char *p = strrchr (path, '/');
+  if (p)
+    *p = '\0';
+  else
+    {
+      path[0] = '.';
+      path[1] = '\0';
+    }
+  return path;
+}
+
+int
+main (int argc, char **argv)
+{
+  int i;
+  int ret = 0;
+  char *p;
+
+  printf ("Welcome to GNU libtool mdemo!\n");
+
+  if (argc < 2) {
+    fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
+  }
+
+  LTDL_SET_PRELOADED_SYMBOLS();
+  if (lt_dlinit() != 0) {
+    fprintf (stderr, "error during initialization: %s\n", lt_dlerror());
+    return 1;
+  }
+
+  for (i = 1; i < argc; i++)
+  {
+    if (test_dl(argv[i], 0))
+       ret = 1;
+    p = strrchr(argv[i], '.');
+    if (p)
+      {
+       *p = '\0';
+       if (test_dl(argv[i], 1))
+         ret = 1;
+       *p = '.';
+      }
+  }
+
+  if (test_dlself())
+    ret = 1;
+
+  for (i = 1; i < argc; i++)
+    if (argv[i][0] != '\0')
+      {
+       my_dirname (argv[i]);
+       if (try_iterate (argv[i]))
+         ret = 1;
+      }
+
+  lt_dlexit();
+  return ret;
+}
+]])
+
+AT_DATA([expout],
+[[Welcome to GNU Hell!
+cos (0.0) = 1
+** This is not GNU Hello. There is no built-in mail reader. **
+]])
+
+prefixdir=`pwd`/_inst
+]) # _LT_SETUP
+
+
+# _LT_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_CHECK_CONFIG],
+[LT_AT_BOOTSTRAP([], [-I m4], [ignore], [--add-missing], [],
+        [--prefix="$prefixdir" $1], [ignore])
+m4_if([$#], 0, [],
+      [$#], 1, [], [$0_(m4_shift($@))])
+])
+m4_define([_LT_CHECK_CONFIG_],
+[AT_CHECK([$EGREP '$1' libtool], 0, [ignore])
+ m4_if([$#], 1, [], [$0(m4_shift($@))])
+])
+
+
+# _LT_CHECK_EXECUTE([TARGETS])
+# ----------------------------
+# Run the listed make rules, and check that the built binaries work.
+m4_define([_LT_CHECK_EXECUTE],
+[LT_AT_MAKE([$1])
+LT_AT_EXEC_CHECK([./mdemo_static], 0, [ignore], [],
+    [./foo1.la ./libfoo2.la | grep '^try_iterate: '])
+LT_AT_EXEC_CHECK([./mdemo], 0, [ignore], [],
+    [./foo1.la ./libfoo2.la | grep '^try_iterate: '])
+LT_AT_EXEC_CHECK([./mdemo_static], 0, [ignore], [],
+    [`pwd`/foo1.la `pwd`/libfoo2.la | grep '^try_iterate: '])
+LT_AT_EXEC_CHECK([./mdemo], 0, [ignore], [],
+    [`pwd`/foo1.la `pwd`/libfoo2.la | grep '^try_iterate: '])
+])
+
+# _LT_CHECK_INSTALL
+# -----------------
+# Run the make install rule, and check that installed binaries work too.
+m4_define([_LT_CHECK_INSTALL],
+[LT_AT_MAKE([install])
+
+# Windows hosts search for dlls in the command path.
+PATH=$prefixdir/lib:$PATH
+
+LT_AT_EXEC_CHECK([$prefixdir/bin/mdemo_static], 0, [ignore], [],
+    [$prefixdir/lib/foo1.la $prefixdir/lib/libfoo2.la | grep '^try_iterate: '])
+LT_AT_EXEC_CHECK([$prefixdir/bin/mdemo], 0, [ignore], [],
+    [$prefixdir/lib/foo1.la $prefixdir/lib/libfoo2.la | grep '^try_iterate: '])
+])
+
+# _LT_CHECK_UNINSTALL
+# -------------------
+# Make sure uninstallation is complete.
+m4_define([_LT_CHECK_UNINSTALL],
+[LT_AT_MAKE([uninstall])
+
+leftovers=`find $prefixdir ! -type d ! -name '.*' -print`
+AT_CHECK([test -z "$leftovers"])
+])
+
+
+## ------------- ##
+## Mdemo static. ##
+## ------------- ##
+
+AT_SETUP([dynamically ltdl preload static modules])
+
+_LT_SETUP
+
+_LT_CHECK_CONFIG([--disable-shared],
+                 [^build_old_libs=yes], [^build_libtool_libs=no])
+_LT_CHECK_EXECUTE
+_LT_CHECK_INSTALL
+_LT_CHECK_UNINSTALL
+
+AT_CLEANUP
+
+
+## ------------- ##
+## Mdemo shared. ##
+## ------------- ##
+
+AT_SETUP([dynamically ltdl load a shared module])
+
+_LT_SETUP
+
+_LT_CHECK_CONFIG([--disable-static],
+                 [^build_old_libs=no], [^build_libtool_libs=yes])
+_LT_CHECK_EXECUTE
+_LT_CHECK_INSTALL
+_LT_CHECK_UNINSTALL
+
+AT_CLEANUP
+
+
+## ----------- ##
+## Mdemo conf. ##
+## ----------- ##
+
+AT_SETUP([ltdl load shared and static modules])
+
+_LT_SETUP
+
+_LT_CHECK_CONFIG([],
+                 [^build_old_libs=yes], [^build_libtool_libs=yes])
+_LT_CHECK_EXECUTE
+_LT_CHECK_INSTALL
+_LT_CHECK_UNINSTALL
+
+AT_CLEANUP
+
+
+## ------------- ##
+## Mdemo dryrun. ##
+## ------------- ##
+
+AT_SETUP([ltdl dryrun])
+
+_LT_SETUP
+
+_LT_CHECK_CONFIG
+_LT_CHECK_EXECUTE
+
+# Unfortunately, in order to test libtool thoroughly, we need access
+# to its private directory.
+eval "`$LIBTOOL --config | $EGREP '^(objdir|objext)='`"
+
+# create `before' and `after' in a directory deep within objdir,
+# so that their creation and removal does not modify even a timestamp
+# in the output of `ls -l . $objdir'
+$lt_INSTALL -d "$objdir/temp/temp"
+before=$objdir/temp/temp/before
+after=$objdir/temp/temp/after
+
+# Create a new libtool script that will enter dry run if the environment
+# variable force_dry_run is set
+sed 's|^opt_dry_run=.*$|opt_dry_run=$force_dry_run|' libtool > ltnew && mv 
ltnew libtool
+export force_dry_run
+
+# main.o is not compiled with libtool, but it depends on it, so make
+# sure it is up-to-date.  libfoo2.la is linked with libsub.la, so make
+# sure it exists, otherwise libtool will complain.
+force_dry_run=false
+LT_AT_MAKE([main.$objext])
+
+# Making object files
+# ls -l in MSYS sometimes shows year, not time, for really fresh files.
+sleep 1
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
+force_dry_run=:
+LT_AT_MAKE([foo1.lo foo2.lo libsub.la])
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
+AT_CHECK([cmp "$before" "$after"], 0, [ignore])
+
+# Now really make them
+force_dry_run=false
+LT_AT_MAKE([foo1.lo foo2.lo libsub.la])
+
+# Making libraries
+sleep 1 # for MSYS
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
+force_dry_run=:
+LT_AT_MAKE([foo1.la libfoo2.la])
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
+AT_CHECK([cmp "$before" "$after"], 0, [ignore])
+
+# Now really make them
+force_dry_run=false
+LT_AT_MAKE([foo1.la libfoo2.la])
+
+# Making programs
+sleep 1 # for MSYS
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
+force_dry_run=:
+LT_AT_MAKE([mdemo$EXEEXT mdemo_static$EXEEXT])
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
+AT_CHECK([cmp "$before" "$after"], 0, [ignore])
+
+# Now really make them
+force_dry_run=false
+LT_AT_MAKE([mdemo$EXEEXT mdemo_static$EXEEXT])
+
+# Running $MAKE install
+# Libtool does not create these directories
+$lt_INSTALL -d "$prefixdir/bin"
+$lt_INSTALL -d "$prefixdir/lib"
+
+sleep 1 # for MSYS
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
+ls -lR "$prefixdir" | $EGREP -v '(^total|testsuite.log$)' >> "$before"
+force_dry_run=:
+LT_AT_MAKE([install])
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
+ls -lR "$prefixdir" | $EGREP -v '(^total|testsuite.log$)' >> "$after"
+AT_CHECK([cmp "$before" "$after"], 0, [ignore])
+
+# Now really install
+force_dry_run=false
+LT_AT_MAKE([install])
+
+# Running $MAKE uninstall
+# Libtool does not uninstall the programs, remove them first
+rm -f "$prefixdir/bin/mdemo$EXEEXT" "$prefixdir/bin/mdemo_static$EXEEXT"
+
+sleep 1 # for MSYS
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
+ls -lR "$prefixdir" | $EGREP -v '(^total|testsuite.log$)' >> "$before"
+force_dry_run=:
+LT_AT_MAKE([uninstall])
+ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
+ls -lR "$prefixdir" | $EGREP -v '(^total|testsuite.log$)' >> "$after"
+AT_CHECK([cmp "$before" "$after"], 0, [ignore])
+
+# Now really uninstall
+force_dry_run=false
+_LT_CHECK_UNINSTALL
+
+AT_CLEANUP
diff --git a/tests/mdemo/.gitignore b/tests/mdemo/.gitignore
deleted file mode 100644
index 458a9c6..0000000
--- a/tests/mdemo/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/mdemo
-/mdemo_static
diff --git a/tests/mdemo/Makefile.am b/tests/mdemo/Makefile.am
deleted file mode 100644
index ff9e459..0000000
--- a/tests/mdemo/Makefile.am
+++ /dev/null
@@ -1,87 +0,0 @@
-## Makefile.am -- Process this file with automake to produce Makefile.in
-##
-##   Copyright (C) 2003, 2004, 2005, 2007, 2008 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)/../.. $(INCLTDL)
-
-lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la libmlib.la
-
-foo1_la_SOURCES = foo1.c
-foo1_la_LIBADD = $(LIBM) libsub.la
-foo1_la_LDFLAGS = -no-undefined -module -avoid-version
-
-libfoo2_la_SOURCES = foo2.c
-libfoo2_la_LIBADD = $(LIBM) libsub.la
-libfoo2_la_LDFLAGS = -no-undefined -module -export-symbols-regex "libfoo2.*"
-
-libsub_la_SOURCES = sub.c
-libsub_la_LDFLAGS = -no-undefined
-
-## Use -export-symbols-regex here explicitly because libltdl marks
-## its exported symbols, and we use libltdl as a convenience archive.
-## Thus, on w32, auto-exporting is turned off.
-libmlib_la_SOURCES = mlib.c
-libmlib_la_LIBADD = $(LIBLTDL) "-dlopen" foo1.la "-dlopen" libfoo2.la
-libmlib_la_LDFLAGS = -no-undefined -export-symbols-regex ".*"
-libmlib_la_DEPENDENCIES = $(LIBLTDL) libsub.la foo1.la libfoo2.la
-
-noinst_HEADERS = foo.h
-
-bin_PROGRAMS = mdemo mdemo_static
-
-top_distdir = ../..
-$(LIBLTDL): $(top_distdir)/libtool \
-    $(top_distdir)/config.h $(srcdir)/$(top_distdir)/libltdl/ltdl.c \
-    $(srcdir)/$(top_distdir)/libltdl/ltdl.h
-       (cd $(top_distdir); $(MAKE) `echo $(LIBLTDL) | sed 
's|.*\.\./libltdl/|libltdl/|g'`)
-# Do not error out if toplevel config.h does not exist:
-$(top_distdir)/config.h:
-
-# Create a version of mdemo that does dlopen.
-mdemo_SOURCES = main.c
-mdemo_LDFLAGS = -export-dynamic
-## The quotes around -dlopen below fool automake into accepting it
-mdemo_LDADD = $(LIBLTDL) libsub.la "-dlopen" self \
-               "-dlopen" foo1.la "-dlopen" libfoo2.la
-mdemo_DEPENDENCIES = $(LIBLTDL) libsub.la foo1.la libfoo2.la
-
-# Create a statically linked version of mdemo.
-mdemo_static_SOURCES = $(mdemo_SOURCES)
-mdemo_static_LDFLAGS = $(STATIC) $(mdemo_LDFLAGS)
-mdemo_static_LDADD = $(mdemo_LDADD)
-mdemo_static_DEPENDENCIES = $(mdemo_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/mdemo/README b/tests/mdemo/README
deleted file mode 100644
index aa4cebb..0000000
--- a/tests/mdemo/README
+++ /dev/null
@@ -1,16 +0,0 @@
-This is mdemo, an example package that uses GNU libtool with an
-Automake-generated environment to build two simple modules and
-a program.
-
-It demonstrates how to build both dynamic and static libraries
-that can be dlopened. mdemo uses libtool's portable dlopen
-wrapper called "libltdl".
-All exported symbols are prefixed with "libname_LTX_" to avoid
-symbols conflicts, especially when linking statically.
-libltdl will automatically cut the prefix off to get the real name.
-
-Note that on Windows, for the purposes of illustrating ltdl, the
-libraries *are* built as dll's, but do not have the __declspec
-machinery to make them suitable for loading at link time.  This is
-only for clarity inside this example, look at the example in ../demo
-to see how the __declspec macros should be set up.
diff --git a/tests/mdemo/configure.ac b/tests/mdemo/configure.ac
deleted file mode 100644
index 8476b5d..0000000
--- a/tests/mdemo/configure.ac
+++ /dev/null
@@ -1,72 +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([mdemo], [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. ##
-## ----------------------- ##
-LTDL_CONVENIENCE([../../libltdl])
-AC_SUBST([INCLTDL])
-AC_SUBST([LIBLTDL])
-
-LT_INIT([dlopen win32-dll])
-AC_SUBST(LIBTOOL_DEPS)
-
-STATIC=
-test yes = "$enable_static" && STATIC="-static"
-AC_SUBST([STATIC])
-
-
-## ---------------------------- ##
-## Libraries required by mdemo. ##
-## ---------------------------- ##
-LT_LIB_M
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/tests/mdemo/foo.h b/tests/mdemo/foo.h
deleted file mode 100644
index 8820813..0000000
--- a/tests/mdemo/foo.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* foo.h -- interface to the libfoo* libraries
-
-   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.
-*/
-
-/* Only include this header file once. */
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-/* __BEGIN_DECLS should be used at the beginning of your declarations,
-   so that C++ compilers don't mangle their names.  Use __END_DECLS at
-   the end of C declarations. */
-#undef __BEGIN_DECLS
-#undef __END_DECLS
-#ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
-#else
-# define __BEGIN_DECLS /* empty */
-# define __END_DECLS /* empty */
-#endif
-
-/* Silly constants that the functions return. */
-#define HELLO_RET 0xe110
-#define FOO_RET 0xf00
-
-extern void sub();
-
-#endif /* !_FOO_H_ */
diff --git a/tests/mdemo/foo1.c b/tests/mdemo/foo1.c
deleted file mode 100644
index 452ee59..0000000
--- a/tests/mdemo/foo1.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* foo1.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>
-
-#define nothing foo1_LTX_nothing
-#define foo1   foo1_LTX_foo1
-#define hello  foo1_LTX_hello
-
-/* Give a global variable definition. */
-int nothing;
-
-/* private function */
-int
-_foo1_helper()
-{
-  sub();
-  return FOO_RET;
-}
-
-/* exported functions */
-__BEGIN_DECLS
-
-int
-foo1()
-{
-  printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
-  return _foo1_helper();
-}
-
-int
-hello()
-{
-  printf ("** This is foolib 1 **\n");
-  return HELLO_RET;
-}
-
-__END_DECLS
diff --git a/tests/mdemo/foo2.c b/tests/mdemo/foo2.c
deleted file mode 100644
index e263285..0000000
--- a/tests/mdemo/foo2.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* foo2.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>
-
-#define nothing libfoo2_LTX_nothing
-#define foo2   libfoo2_LTX_foo2
-#define hello  libfoo2_LTX_hello
-
-/* Give a global variable definition. */
-int nothing;
-
-/* private function */
-int
-_foo2_helper()
-{
-  sub();
-  return FOO_RET;
-}
-
-/* exported functions */
-__BEGIN_DECLS
-
-int
-foo2()
-{
-  printf ("sin (0.0) = %g\n", (double) sin ((double) 0.0));
-  return _foo2_helper();
-}
-
-int
-hello()
-{
-  printf ("** This is foolib 2 **\n");
-  return HELLO_RET;
-}
-
-__END_DECLS
diff --git a/tests/mdemo/main.c b/tests/mdemo/main.c
deleted file mode 100644
index ea732a9..0000000
--- a/tests/mdemo/main.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* main.c -- mdemo test program
-
-   Copyright (C) 1998-2000, 2006, 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 "ltdl.h"
-#include <stdio.h>
-#include <string.h>
-
-LT_BEGIN_C_DECLS
-extern int myfunc (void);
-LT_END_C_DECLS
-
-int
-test_dl (char *filename, int test_ext)
-{
-  lt_dlhandle handle;
-  const lt_dlinfo *info;
-  int (*pfoo1)() = 0;
-  int (*pfoo2)() = 0;
-  int (*phello)() = 0;
-  int *pnothing = 0;
-  int ret = 0;
-
-  if (test_ext)
-    handle = lt_dlopenext (filename);
-  else
-    handle = lt_dlopen (filename);
-
-  if (!handle) {
-    fprintf (stderr, "can't open the module %s!\n", filename);
-    fprintf (stderr, "error was: %s\n", lt_dlerror());
-    return 1;
-  }
-
-  info = lt_dlgetinfo(handle);
-  if (!info) {
-    fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
-    return 1;
-  }
-  if (info->name) {
-    printf ("module name: %s\n", info->name);
-  } else {
-    printf ("module is not a libtool module\n");
-  }
-  printf ("module filename: %s\n", info->filename);
-  printf ("module reference count: %i\n", info->ref_count);
-
-  phello = (int(*)())lt_dlsym(handle, "hello");
-  if (phello)
-    {
-      int value = (*phello) ();
-
-      printf ("hello returned: %i\n", value);
-      if (value == HELLO_RET)
-        printf("hello is ok!\n");
-    }
-  else
-    {
-      fprintf (stderr, "did not find the `hello' function\n");
-      fprintf (stderr, "error was: %s\n", lt_dlerror());
-      ret = 1;
-    }
-
-  pnothing = (int*)lt_dlsym(handle, "nothing");
-  /* Try assigning to the nothing variable. */
-  if (pnothing)
-    *pnothing = 1;
-  else
-    {
-      fprintf (stderr, "did not find the `nothing' variable\n");
-      fprintf (stderr, "error was: %s\n", lt_dlerror());
-      ret = 1;
-    }
-
-  pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
-  /* Just call the functions and check return values. */
-  if (pfoo1)
-    {
-      if ((*pfoo1) () == FOO_RET)
-        printf("foo1 is ok!\n");
-      else
-       ret = 1;
-    }
-  else {
-    pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
-    if (pfoo2)
-      {
-        if ((*pfoo2) () == FOO_RET)
-          printf("foo2 is ok!\n");
-        else ret = 1;
-      }
-    else
-      {
-        fprintf (stderr, "did not find any of the `foo' functions\n");
-        fprintf (stderr, "error was: %s\n", lt_dlerror());
-        ret = 1;
-      }
-  }
-  lt_dlclose(handle);
-  return ret;
-}
-
-int
-myfunc ()
-{
-  return HELLO_RET;
-}
-
-int myvar;
-
-int
-test_dlself ()
-{
-  lt_dlhandle handle;
-  int (*pmyfunc)() = 0;
-  int *pmyvar = 0;
-  int ret = 0;
-
-  handle = lt_dlopen(0);
-  if (!handle) {
-    fprintf (stderr, "can't dlopen the program!\n");
-    fprintf (stderr, "error was: %s\n", lt_dlerror());
-    return 1;
-  }
-
-  pmyfunc = (int(*)())lt_dlsym(handle, "myfunc");
-  if (pmyfunc)
-    {
-      int value = (*pmyfunc) ();
-
-      printf ("myfunc returned: %i\n", value);
-      if (value == HELLO_RET)
-        printf("myfunc is ok!\n");
-    }
-  else
-    {
-      fprintf (stderr, "did not find the `myfunc' function\n");
-      fprintf (stderr, "error was: %s\n", lt_dlerror());
-      ret = 1;
-    }
-
-  pmyvar = (int*)lt_dlsym(handle, "myvar");
-  /* Try assigning to the variable. */
-  if (pmyvar)
-    *pmyvar = 1;
-  else
-    {
-      fprintf (stderr, "did not find the `myvar' variable\n");
-      fprintf (stderr, "error was: %s\n", lt_dlerror());
-      ret = 1;
-    }
-
-  lt_dlclose(handle);
-  return ret;
-}
-
-static int
-callback (const char *filename, void *data)
-{
-  printf ("%s: %s\n", (char *)data, filename);
-  return 0;
-}
-
-static int
-try_iterate (const char *search_path)
-{
-  char *s = "try_iterate";
-  return lt_dlforeachfile (search_path, callback, s);
-}
-
-/* cheap dirname clone.  We require a '/' separator, nonempty and large
-   enough input, not ending with '/', and we will overwrite the input. */
-static char *
-my_dirname (char *path)
-{
-  char *p = strrchr (path, '/');
-  if (p)
-    *p = '\0';
-  else
-    {
-      path[0] = '.';
-      path[1] = '\0';
-    }
-  return path;
-}
-
-int
-main (int argc, char **argv)
-{
-  int i;
-  int ret = 0;
-  char *p;
-
-  printf ("Welcome to GNU libtool mdemo!\n");
-
-  if (argc < 2) {
-    fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
-  }
-
-  LTDL_SET_PRELOADED_SYMBOLS();
-  if (lt_dlinit() != 0) {
-    fprintf (stderr, "error during initialization: %s\n", lt_dlerror());
-    return 1;
-  }
-
-  for (i = 1; i < argc; i++)
-  {
-    if (test_dl(argv[i], 0))
-       ret = 1;
-    p = strrchr(argv[i], '.');
-    if (p)
-      {
-       *p = '\0';
-       if (test_dl(argv[i], 1))
-         ret = 1;
-       *p = '.';
-      }
-  }
-
-  if (test_dlself())
-    ret = 1;
-
-  for (i = 1; i < argc; i++)
-    if (argv[i][0] != '\0')
-      {
-       my_dirname (argv[i]);
-       if (try_iterate (argv[i]))
-         ret = 1;
-      }
-
-  lt_dlexit();
-  return ret;
-}
diff --git a/tests/mdemo/mlib.c b/tests/mdemo/mlib.c
deleted file mode 100644
index 38374a4..0000000
--- a/tests/mdemo/mlib.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* mlib.c -- mlib library
-
-   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
-   Written by Greg Eisenhauer, 2002
-   Extracted from mdemo.c
-
-   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 "ltdl.h"
-#include <stdio.h>
-
-int
-test_dl (char *filename)
-{
-  lt_dlhandle handle;
-  const lt_dlinfo *info;
-  int (*pfoo1)() = 0;
-  int (*pfoo2)() = 0;
-  int (*phello)() = 0;
-  int *pnothing = 0;
-  int ret = 0;
-
-  handle = lt_dlopen(filename);
-  if (!handle) {
-    fprintf (stderr, "can't open the module %s!\n", filename);
-    fprintf (stderr, "error was: %s\n", lt_dlerror());
-    return 1;
-  }
-
-  info = lt_dlgetinfo(handle);
-  if (!info) {
-    fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
-    return 1;
-  }
-  if (info->name) {
-    printf ("module name: %s\n", info->name);
-  } else {
-    printf ("module is not a libtool module\n");
-  }
-  printf ("module filename: %s\n", info->filename);
-  printf ("module reference count: %i\n", info->ref_count);
-
-  phello = (int(*)())lt_dlsym(handle, "hello");
-  if (phello)
-    {
-      int value = (*phello) ();
-
-      printf ("hello returned: %i\n", value);
-      if (value == HELLO_RET)
-        printf("hello is ok!\n");
-    }
-  else
-    {
-      fprintf (stderr, "did not find the `hello' function\n");
-      fprintf (stderr, "error was: %s\n", lt_dlerror());
-      ret = 1;
-    }
-
-  pnothing = (int*)lt_dlsym(handle, "nothing");
-  /* Try assigning to the nothing variable. */
-  if (pnothing)
-    *pnothing = 1;
-  else
-    {
-      fprintf (stderr, "did not find the `nothing' variable\n");
-      fprintf (stderr, "error was: %s\n", lt_dlerror());
-      ret = 1;
-    }
-
-  pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
-  /* Just call the functions and check return values. */
-  if (pfoo1)
-    {
-      if ((*pfoo1) () == FOO_RET)
-        printf("foo1 is ok!\n");
-      else
-       ret = 1;
-    }
-  else {
-    pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
-    if (pfoo2)
-      {
-        if ((*pfoo2) () == FOO_RET)
-          printf("foo2 is ok!\n");
-        else ret = 1;
-      }
-    else
-      {
-        fprintf (stderr, "did not find any of the `foo' functions\n");
-        fprintf (stderr, "error was: %s\n", lt_dlerror());
-        ret = 1;
-      }
-  }
-  lt_dlclose(handle);
-  return ret;
-}
-
-int
-mlib_func (int argc, char **argv)
-{
-  int ret = 0;
-  int i;
-  /*
-   * Would be nice if this somehow worked for libraries, not just executables.
-   * LTDL_SET_PRELOADED_SYMBOLS();
-   */
-  if (lt_dlinit() != 0) {
-    fprintf (stderr, "error during initialization: %s\n", lt_dlerror());
-    return 1;
-  }
-
-  for (i = 1; i < argc; i++)
-    if (test_dl(argv[i]))
-       ret = 1;
-
-  lt_dlexit();
-  return ret;
-}
diff --git a/tests/mdemo/sub.c b/tests/mdemo/sub.c
deleted file mode 100644
index eed001f..0000000
--- a/tests/mdemo/sub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* sub.c -- trivial test library
-
-   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 <stdio.h>
-
-void
-sub ()
-{
-  printf ("sub() called\n");
-}
-- 
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]