"Fossies" - the Fresh Open Source Software Archive

Member "jq-1.6/tests/setup" (2 Nov 2018, 793 Bytes) of package /linux/misc/jq-1.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "setup": 1.5_vs_1.6.

    1 #!/bin/sh
    2 
    3 # This is meant to be included by each test's shell script driver.
    4 
    5 if [ -n "$TRACE_TESTS" ]; then
    6     set -x
    7 fi
    8 
    9 set -eu
   10 
   11 JQTESTDIR=$(cd "$(dirname "$0")" && pwd)
   12 JQBASEDIR=$JQTESTDIR/..
   13 JQ=$JQBASEDIR/jq
   14 
   15 if [ -z "${NO_VALGRIND-}" ] && which valgrind > /dev/null; then
   16     VALGRIND="valgrind --error-exitcode=1 --leak-check=full \
   17                        --suppressions=$JQTESTDIR/onig.supp"
   18     VG_EXIT0=--error-exitcode=0
   19     Q=-q
   20 else
   21     VALGRIND=
   22     VG_EXIT0=
   23     Q=
   24 fi
   25 
   26 mods=$JQTESTDIR/modules
   27 
   28 clean=true
   29 d=
   30 clean () {
   31     if ! $clean; then
   32         echo "See temp files in $d!"
   33     elif [ -n "$d" ]; then
   34         rm -rf "$d"
   35     fi
   36 }
   37 trap clean EXIT
   38 d=$(mktemp -d -t jqXXXXXX || true)
   39 if [ -z "$d" ]; then
   40     echo "Your OS does not support mktemp(1) -d" 1>&2
   41     exit 1
   42 fi