Be more flexible about the path to sharness

Some folks might want to run a different version.

Check all the common installation paths and
support using a custom path to sharness.
This commit is contained in:
Paul Wise
2021-03-31 15:32:45 +08:00
committed by Mark Nauwelaerts
parent 7913920a97
commit ec654d4682

View File

@@ -1,6 +1,24 @@
#!/bin/sh
. ./sharness.sh
if [ -z "$SHARNESS" ] ; then
for d in \
"." \
"$HOME/share/sharness" \
"/usr/local/share/sharness" \
"/usr/share/sharness"
do
f="$d/sharness.sh"
if [ -f "$f" ] ; then
SHARNESS="$f"
fi
done
fi
if [ -z "$SHARNESS" ] || [ ! -f "$SHARNESS" ] ; then
echo "sharness.sh not found" >&2
exit 1
fi
. "$SHARNESS"
test_set_prereq PYTHON