1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

37 lines
700 B
Plaintext
Raw Normal View History

#!/bin/sh
2015-06-26 23:36:34 -05:00
# This is meant to be included by each test's shell script driver.
set -eu
JQTESTDIR=$(cd "$(dirname "$0")" && pwd)
JQBASEDIR=$JQTESTDIR/..
JQ=$JQBASEDIR/jq
if [ -z "${NO_VALGRIND-}" ] && which valgrind > /dev/null; then
VALGRIND="valgrind --error-exitcode=1 --leak-check=full \
--suppressions=$JQTESTDIR/onig.supp"
Q=-q
else
VALGRIND=
Q=
fi
mods=$JQTESTDIR/modules
clean=true
d=
clean () {
if ! $clean; then
echo "See temp files in $d!"
elif [ -n "$d" ]; then
rm -rf "$d"
fi
}
trap clean EXIT
d=`mktemp -d -t jqXXXXXX || true`
if [ -z "$d" ]; then
echo "Your OS does not support mktemp(1) -d" 1>&2
exit 1
fi