summaryrefslogtreecommitdiffstats
path: root/tests/preamble
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-16 12:40:10 +0100
committerMattias Andrée <maandree@kth.se>2023-12-16 12:40:10 +0100
commit683f205402a99cfc8cea46c83ce9b46a42616d42 (patch)
treef6ee1619454a6ec8b9e31770bbbc2abf36aae2fd /tests/preamble
parentImprove portability (diff)
downloadlibsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.gz
libsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.bz2
libsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.xz
All kinds of stuff
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--tests/preamble41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/preamble b/tests/preamble
new file mode 100644
index 0000000..527a098
--- /dev/null
+++ b/tests/preamble
@@ -0,0 +1,41 @@
+# -*- sh -*-
+# See LICENSE file for copyright and license details.
+
+if test $# = 0; then
+ if "$0" fail for me; then
+ printf 'Testing is broken!\n' >&2
+ exit 2
+ fi
+ set +e
+ "$0" $$
+ r=$?
+ rm -f -- .?-$$.tmp
+ exit $r
+fi
+
+
+set -e
+test $# = 1
+pid=$1
+a=.a-$pid.tmp
+b=.b-$pid.tmp
+PATH="$(dirname -- "$0")/testutil:$PATH"
+export PATH
+
+
+if ! env | grep '^SUPPORTED_OSES=' >/dev/null; then
+ printf '%s\n' \
+ "The test's environment has not been set up;" \
+ 'you should run the test via `make check`'
+ exit 1
+fi
+
+. tests/load-functions
+
+alias t='$t'
+
+if ! (. tests/test-self-check) >/dev/null 2>/dev/null; then
+ printf '%s\n' \
+ "The test's self-check failed"
+ exit 1
+fi