Merge branches/quickjs to trunk. This is the way.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3621 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2021-01-02 18:10:00 +00:00
parent d293637741
commit 79022e1e1f
703 changed files with 419987 additions and 30640 deletions

46
deps/xopt/test/test-case.sh vendored Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
#
# To be used with CMake builds located in <xopt>/build/
#
set -uo pipefail
exec >&2
casebin="$1"
caseout="$2"
shift 2
function die {
echo -e "error: $*"
exit 1
}
cd "$(dirname "$0")"
if [ -z "$casebin" ]; then
die 'no test case executable specified'
fi
if [ -z "$caseout" ]; then
die 'no test case output (some-case.out) specified'
fi
if [ ! -x "$casebin" ]; then
die "test case does not exist or is not executable: $casebin"
fi
if [ ! -f "$caseout" ]; then
die "test case expected output file does not exist: $caseout"
fi
output="$("$casebin" "$@" 2>&1)"
r=$?
if [ $r -eq 139 ]; then
die "xopt test case failed with SEGFAULT ($r)"
fi
diff="$(diff -U0 -d -t "$caseout" - <<< "$output" 2>&1)"
if [ ! -z "$diff" ]; then
die "xopt test case didn't match expected output: '$caseout'\n$diff"
fi