aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/lib/test.sh
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-09-29 23:44:16 +0500
committerEgor Tensin <egor@tensin.name>2026-09-29 23:45:40 +0500
commiteec673b5c0122e359bf00b0136783a32e8a77df9 (patch)
tree61457ccf0d65331f1411b28aa7ba2ad964191ba2 /test/lib/test.sh
parentremove annoying trailing period from repo URLs (diff)
downloadvk-scripts-eec673b5c0122e359bf00b0136783a32e8a77df9.tar.gz
vk-scripts-eec673b5c0122e359bf00b0136783a32e8a77df9.zip
test: rework using the approach from my other projectsv1.2.0
The tests are now run using a framework common to my other projects, like config-links & tag-release.
Diffstat (limited to '')
-rw-r--r--[-rwxr-xr-x]test/lib/test.sh32
1 files changed, 15 insertions, 17 deletions
diff --git a/test/lib/test.sh b/test/lib/test.sh
index 56b3235..30c4ce1 100755..100644
--- a/test/lib/test.sh
+++ b/test/lib/test.sh
@@ -1,27 +1,25 @@
-#!/usr/bin/env bash
-
# Copyright (c) 2020 Egor Tensin <egor@tensin.name>
# This file is part of the "VK scripts" project.
# For details, see https://github.com/egor-tensin/vk-scripts
# Distributed under the MIT License.
-set -o errexit -o nounset -o pipefail
+test_should_fail=
+test_root_dir=
-script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
-script_dir="$( cd -- "$script_dir" && pwd )"
-readonly script_dir
+test_setup() {
+ test_root_dir="$( mktemp -d )"
-run_test() {
- local arg
- echo
- echo ======================================================================
- for arg; do
- echo -n "$arg "
- done
- echo
- echo ======================================================================
+ log "Root directory: $test_root_dir"
+}
- PYTHONPATH="$script_dir/../.." python -m "$@"
+test_cleanup_default() {
+ if [ -n "$test_root_dir" ]; then
+ log "Removing test's root directory: $test_root_dir"
+ rm -rf -- "$test_root_dir"
+ fi
}
-run_test "$@"
+test_run_module() {
+ log_run python -m "$@"
+ PYTHONPATH="$script_dir/.." python -m "$@"
+}