summaryrefslogtreecommitdiffstatshomepage
path: root/test/lib/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/test.sh')
-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 "$@"
+}