21 lines
467 B
Bash
Executable file
21 lines
467 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
SCRIPT_DIR="$(cd -- "$(dirname -- "$0")" && pwd)"
|
|
cd "${SCRIPT_DIR}/tool" || return
|
|
|
|
export JQ_TYPECHECKING=1
|
|
|
|
runTests() {
|
|
JQ=${JQ:-jq}
|
|
export JQ_FLAVOR=${JQ_FLAVOR:-jq}
|
|
echo "Running Tests with JQ=${JQ}"
|
|
${JQ} -nr \
|
|
-L "$(realpath .)" -L "$(realpath ./lib)" -L "$(realpath ./dropins)/${JQ_FLAVOR}" \
|
|
"include \"tests\"; testsMain"
|
|
}
|
|
|
|
runTests
|
|
|
|
if command -v gojq 2>/dev/null >/dev/null; then
|
|
JQ=gojq JQ_FLAVOR=gojq runTests
|
|
fi |