42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Test that "make install" installs the expected minimum set of files.
|
|
|
|
true "${testSubject:?not set - call this from 'make check'}"
|
|
true "${workFile1:?not set - call this from 'make check'}"
|
|
|
|
makeDir="${testSubject%/*}"
|
|
if ! test -d "${makeDir}"; then
|
|
echo "could not find the directory to run \`make' in"
|
|
exit 77
|
|
fi
|
|
|
|
makeCommand=$(command -v gmake 2>/dev/null)
|
|
test -z "${makeCommand}" && makeCommand="make"
|
|
|
|
testInstallDir=$(mktemp -d)
|
|
if ! test -n "${testInstallDir}"; then
|
|
echo "failed to create temporary installation directory"
|
|
exit 77
|
|
fi
|
|
|
|
export DESTDIR="${testInstallDir}"
|
|
if ! ${makeCommand} -C "${makeDir}" install DESTDIR="${testInstallDir}" >"${workFile1}" 2>&1; then
|
|
echo "\`make install' exited $?"
|
|
rm -rf "${testInstallDir}"
|
|
exit 1
|
|
fi
|
|
|
|
exitStatus=0
|
|
if ! find "${testInstallDir}" -type f -name "pv.1*" | grep -Fq "pv.1"; then
|
|
echo "installation of man page failed"
|
|
exitStatus=1
|
|
fi
|
|
if ! find "${testInstallDir}" -type f -name "pv*" | grep -Fv "pv.1" | grep -Fq "pv"; then
|
|
echo "installation of binary failed"
|
|
exitStatus=1
|
|
fi
|
|
|
|
rm -rf "${testInstallDir}"
|
|
exit "${exitStatus}"
|