Skip to content
Myr

setup

This file

Path

tests/setup

47 lines · 960 bytes

Last changed by

Disable Valgrind by default during testing (#3269)itchynybefore adoption5df471f

History of this file

Take it

1#!/bin/sh23# This is meant to be included by each test's shell script driver.45if [ -n "$TRACE_TESTS" ]; then6    set -x7fi89set -eu1011JQTESTDIR=$(cd "$(dirname "$0")" && pwd)12JQBASEDIR=$JQTESTDIR/..13JQ=${JQ:-$JQBASEDIR/jq}1415# Some tests have locale-dependent output; use C locale.  Fixes #303816LC_ALL=C17export LC_ALL1819if [ -n "${ENABLE_VALGRIND-}" ] && which valgrind > /dev/null; then20    VALGRIND="valgrind --error-exitcode=1 --leak-check=full \21                       --suppressions=$JQTESTDIR/onig.supp \22                       --suppressions=$JQTESTDIR/local.supp"23    VG_EXIT0=--error-exitcode=024    Q=-q25else26    VALGRIND=27    VG_EXIT0=28    Q=29fi3031mods=$JQTESTDIR/modules3233clean=true34d=35clean () {36    if ! $clean; then37        echo "See temp files in $d!"38    elif [ -n "$d" ]; then39        rm -rf "$d"40    fi41}42trap clean EXIT43d=$(mktemp -d -t jqXXXXXX || true)44if [ -z "$d" ]; then45    echo "Your OS does not support mktemp(1) -d" 1>&246    exit 147fi