libtool/tests/demo.test
1997-04-01 19:21:43 +00:00

80 lines
1.7 KiB
Bash

#! /bin/sh
# demo.test - try building in the ../demo subdirectory
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../demo || mkdir ../demo
# Change to our build directory.
cd ../demo || exit 1
# Possibly clean up the distribution.
if test -f config.cache; then
echo "= Running make distclean in ../demo"
make distclean || rm -f config.cache
fi
# Configure the demonstration.
echo "= Configuring in ../demo (prefix=$prefix)"
$srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix || exit 1
# Do the actual build.
echo "= Running make in ../demo"
make || exit 1
# Try running the program.
echo "= Executing uninstalled programs"
if ./hell.static | grep 'GNU Hell'; then :
else
echo "$0: cannot execute ./hell.static" 1>&2
exit 1
fi
if ./hell | grep 'GNU Hell'; then :
else
echo "$0: cannot execute ./hell" 1>&2
exit 1
fi
echo "= Running make install in ../demo"
make install || exit 1
echo "= Executing installed programs"
if $prefix/bin/hell.static | grep 'GNU Hell'; then :
else
echo "$0: cannot execute $prefix/bin/hell.static" 1>&2
exit 1
fi
if $prefix/bin/hell | grep 'GNU Hell'; then :
else
echo "$0: warning: cannot execute $prefix/bin/hell" 1>&2
fi
echo "= Running make uninstall in ../demo"
make uninstall || exit 1
# See that there were no files leftover in $prefix.
leftovers=`find $prefix ! -type d -print`
if test -n "$leftovers"; then
echo "= Leftover after make uninstall:"
ls -l $leftovers
exit 1
fi
# Delete the directory tree we created.
rm -rf $prefix
# Clean up the distribution.
make distclean
exit 0