diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-14 22:50:19 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-14 22:50:19 +0500 |
| commit | 1113be584b46e7e037a2bc4ece9b3b938969ec75 (patch) | |
| tree | 937e7a6cf516db8c27c5373aae5ccfcbf9c8cd55 /src/test.sh | |
| parent | main.sh: add proper command line parameters & usage info (diff) | |
| download | test-harness-0.3.0.tar.gz test-harness-0.3.0.zip | |
shuffle files around, add the top-level symlinkv0.3.0
Diffstat (limited to 'src/test.sh')
| -rw-r--r-- | src/test.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test.sh b/src/test.sh new file mode 100644 index 0000000..7c5844b --- /dev/null +++ b/src/test.sh @@ -0,0 +1,23 @@ +# Copyright (c) 2026 Egor Tensin <egor@tensin.name> +# This file is part of the "test-harness" project. +# For details, see https://github.com/egor-tensin/test-harness +# Distributed under the MIT License. + +test_should_fail= +test_root_dir= + +_test_setup_global() { + test_root_dir="$( mktemp -d )" + # mktemp returns /var/..., which is actually in /private/var/... on macOS. + test_root_dir="$( readlink -e -- "$test_root_dir" )" +} + +_test_cleanup_global() { + if [ "$( type -t test_cleanup )" == function ]; then + test_cleanup || true + fi + if [ -n "$test_root_dir" ]; then + log "Removing test's root directory: $test_root_dir" + rm -rf -- "$test_root_dir" + fi +} |
