@table @file
-@item assign.test
-@pindex assign.test
-Checks whether we don't put break or continue on the same
-line as an assignment in the libtool script.
+@item cdemo-conf.test
+@itemx cdemo-exec.test
+@itemx cdemo-make.test
+@itemx cdemo-static.test
+@itemx cdemo-shared.test
+@pindex cdemo-conf.test
+@pindex cdemo-exec.test
+@pindex cdemo-make.test
+@pindex cdemo-static.test
+@pindex cdemo-shared.test
+These programs check to see that the @file{cdemo} subdirectory of the
+libtool distribution can be configured and built correctly.
+
+The @file{cdemo} subdirectory contains a demonstration of libtool
+convenience libraries, a mechanism that allows build-time static
+libraries to be created, in a way that their components can be later
+linked into programs or other libraries, even shared ones.
+
+The tests @file{cdemo-make.test} and @file{cdemo-exec.test} are executed
+three times, under three different libtool configurations:
+@file{cdemo-conf.test} configures @file{cdemo/libtool} to build both
+static and shared libraries (the default for platforms that support
+both), @file{cdemo-static.test} builds only static libraries
+(@samp{--disable-shared}), and @file{cdemo-shared.test} builds only
+shared libraries (@samp{--disable-static}).
@item demo-conf.test
@itemx demo-exec.test
This tests checks whether libtool's @code{deplibs_check_method}
works properly.
+@item hardcode.test
+@pindex hardcode.test
+On all systems with shared libraries, the location of the library can be
+encoded in executables that are linked against it @pxref{Linking
+executables}. This test checks the conditions under which your system
+linker hardcodes the library location, and guarantees that they
+correspond to libtool's own notion of how your linker behaves.
+
+@item build-relink.test
+@pindex build-relink.test
+Checks whether variable @var{shlibpath_overrides_runpath} is properly
+set. If the test fails and @var{VERBOSE} is set, it will indicate what
+the variable should have been set to.
+
+@item noinst-link.test
+@pindex noinst-link.test
+Checks whether libtool will not try to link with a previously installed
+version of a library when it should be linking with a just-built one.
+
@item mdemo-conf.test
@itemx mdemo-exec.test
@itemx mdemo-inst.test
libraries (@samp{--disable-shared}), and @file{mdemo-shared.test} builds
only shared libraries (@samp{--disable-static}).
-@item cdemo-conf.test
-@itemx cdemo-exec.test
-@itemx cdemo-make.test
-@itemx cdemo-static.test
-@itemx cdemo-shared.test
-@pindex cdemo-conf.test
-@pindex cdemo-exec.test
-@pindex cdemo-make.test
-@pindex cdemo-static.test
-@pindex cdemo-shared.test
-These programs check to see that the @file{cdemo} subdirectory of the
-libtool distribution can be configured and built correctly.
+@item dryrun.test
+@pindex dryrun.test
+This test checks whether libtool's @code{--dry-run} mode works properly.
-The @file{cdemo} subdirectory contains a demonstration of libtool
-convenience libraries, a mechanism that allows build-time static
-libraries to be created, in a way that their components can be later
-linked into programs or other libraries, even shared ones.
-
-The tests @file{cdemo-make.test} and @file{cdemo-exec.test} are executed
-three times, under three different libtool configurations:
-@file{cdemo-conf.test} configures @file{cdemo/libtool} to build both
-static and shared libraries (the default for platforms that support
-both), @file{cdemo-static.test} builds only static libraries
-(@samp{--disable-shared}), and @file{cdemo-shared.test} builds only
-shared libraries (@samp{--disable-static}).
-
-@item hardcode.test
-@pindex hardcode.test
-On all systems with shared libraries, the location of the library can be
-encoded in executables that are linked against it @pxref{Linking
-executables}. This test checks the conditions under which your system
-linker hardcodes the library location, and guarantees that they
-correspond to libtool's own notion of how your linker behaves.
-
-@item build-relink.test
-@pindex build-relink.test
-Checks whether variable @var{shlibpath_overrides_runpath} is properly
-set. If the test fails and @var{VERBOSE} is set, it will indicate what
-the variable should have been set to.
-
-@item noinst-link.test
-@pindex noinst-link.test
-Checks whether libtool will not try to link with a previously installed
-version of a library when it should be linking with a just-built one.
+@item assign.test
+@pindex assign.test
+Checks whether we don't put break or continue on the same
+line as an assignment in the libtool script.
@item link.test
@pindex link.test
--- /dev/null
+#! /bin/sh
+# dryrun.test - check whether the --dry-run mode works properly
+
+# Test script header.
+need_prefix=yes
+if test -z "$srcdir"; then
+ srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+ test "$srcdir" = "$0" && srcdir=.
+ test "${VERBOSE+set}" != "set" && VERBOSE=yes
+fi
+. $srcdir/defs || exit 1
+
+if test -f ../mdemo/Makefile; then :
+else
+ echo "You must run mdemo-conf.test before running $0" 1>&2
+ exit 77
+fi
+
+# Change to our build directory.
+cd ../mdemo || exit 1
+
+echo "= Running $make clean in ../mdemo"
+$make clean || exit 1
+
+$make main.o || exit 1
+mkdir .libs
+rm -f .before .after
+
+echo "= Making object files in ../mdemo"
+ls -l . .libs > .before
+$make LIBTOOL="libtool -n" foo1.lo foo2.lo || exit 1
+ls -l . .libs > .after
+diff .before .after > /dev/null || exit 1
+# Now really make them
+$make foo1.lo foo2.lo || exit 1
+
+echo "= Making libraries in ../mdemo"
+ls -l . .libs > .before
+$make LIBTOOL="libtool -n" foo1.la libfoo2.la || exit 1
+ls -l . .libs > .after
+diff .before .after > /dev/null || exit 1
+# Now really make them
+$make foo1.la libfoo2.la || exit 1
+
+echo "= Making programs in ../mdemo"
+ls -l . .libs > .before
+$make LIBTOOL="libtool -n" mdemo mdemo.static || exit 1
+ls -l . .libs > .after
+diff .before .after > /dev/null || exit 1
+# Now really make them
+$make mdemo mdemo.static || exit 1
+
+echo "= Running $make install in ../mdemo"
+# Libtool does not create these directories
+mkdir $prefix/bin
+mkdir $prefix/lib
+ls -l . .libs > .before
+ls -lR $prefix >> .before
+$make LIBTOOL="libtool -n" install || exit 1
+ls -l . .libs > .after
+ls -lR $prefix >> .after
+diff .before .after > /dev/null || exit 1
+# Now really run it
+$make install || exit 1
+
+echo "= Running $make uninstall in ../mdemo"
+ls -l . .libs > .before
+ls -lR $prefix >> .before
+# Libtool does not uninstall the programs, save them
+cp $prefix/bin/mdemo mdemo.sav
+cp $prefix/bin/mdemo.static mdemo.static.sav
+$make LIBTOOL="libtool -n" uninstall || exit 1
+# Restore them
+mv mdemo.sav $prefix/bin/mdemo
+mv mdemo.static.sav $prefix/bin/mdemo.static
+ls -l . .libs > .after
+ls -lR $prefix >> .after
+diff .before .after > /dev/null || exit 1
+# Now really run it
+$make uninstall || exit 1
+
+rm -f .before .after
+
+exit 0