3 # Copyright (c) 2019, 2020 Stefan Sperling <stsp@openbsd.org>
4 # Copyright (c) 2024 Mark Jamsek <mark@jamsek.dev>
6 # Permission to use, copy, modify, and distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .
${GOTWEBD_TEST_DATA_DIR}/..
/cmdline
/common.sh
23 's/\$\{(\w+)\}/(exists $ENV{$1} ? $ENV{$1} : "UNDEFINED $1")/eg' \
32 if [ -n "$repo" ]; then
33 git_fsck
$testroot $repo
35 if [ $ret -ne 0 ]; then
49 if [ "$result" = "0" ]; then
50 test_cleanup
"$testroot" "$repo" ||
return 1
51 if [ -z "$GOT_TEST_QUIET" ]; then
54 elif echo "$result" |
grep -q "^xfail"; then
55 # expected test failure; test reproduces an unfixed bug
57 test_cleanup
"$testroot" "$repo" ||
return 1
59 echo "test failed; leaving test data in $testroot"
68 if [ -z "$testname" ]; then
69 echo "No test name provided" >&2
73 local testroot
=$
(mktemp
-d \
74 "$GOTWEBD_TEST_ROOT/gotwebd-test-$testname-XXXXXXXXXX")
76 if [ -z "$no_repo" ]; then
78 git_init
$testroot/repo
79 make_test_tree
$testroot/repo
81 git_commit
$testroot/repo
-m "adding the test tree"
91 if [ -n "$regress_run_only" ]; then
92 case "$regress_run_only" in
98 if [ -z "$GOT_TEST_QUIET" ]; then