File: setup

package info (click to toggle)
jq 1.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,476 kB
  • ctags: 2,144
  • sloc: ansic: 12,692; sh: 11,961; yacc: 821; lex: 184; makefile: 147
file content (37 lines) | stat: -rwxr-xr-x 740 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

# 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="libtool --mode=execute -- 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 jqXXXXX || true`
if [ -z "$d" ]; then
    echo "Your OS does not support mktemp(1) -d" 1>&2
    exit 1
fi