Skip to content

Instantly share code, notes, and snippets.

@chriscool
Last active September 4, 2015 12:23
Show Gist options
  • Save chriscool/94ef32392f6c2a4bd7d7 to your computer and use it in GitHub Desktop.
Save chriscool/94ef32392f6c2a4bd7d7 to your computer and use it in GitHub Desktop.
Alternative code to allow sharness extensions in srcdir/sharness.d
#
# Load any extensions in $srcdir/sharness.d/*.sh
#
if test -d "${SHARNESS_TEST_SRCDIR}/sharness.d"
then
for file in "${SHARNESS_TEST_SRCDIR}"/sharness.d/*.sh
do
# Ensure glob was not an empty match
test -e "${file}" || break
if test -n "$debug"
then
echo >&5 "sharness: loading extensions from ${file}"
fi
. "${file}"
if test $? != 0
then
echo >&5 "sharness: Error loading ${file}. Aborting."
exit 1
fi
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment