summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/custom/run_tests.sh')
-rwxr-xr-xtests/custom/run_tests.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/custom/run_tests.sh b/tests/custom/run_tests.sh
index 2364914..b20404a 100755
--- a/tests/custom/run_tests.sh
+++ b/tests/custom/run_tests.sh
@@ -1,7 +1,10 @@
#!/usr/bin/env bash
+testdir=$(dirname "$0")
+topdir=$(readlink -f "$testdir/../..")
+
line='........................................'
-ucode_bin=${UCODE_BIN:-./ucode}
+ucode_bin=${UCODE_BIN:-"$topdir/ucode"}
extract_sections() {
local file=$1
@@ -48,7 +51,10 @@ run_testcase() {
local code=$6
local fail=0
- $ucode_bin -e '{ "REQUIRE_SEARCH_PATH": [ "./lib/*.so" ] }' -i - <"$in" >"$dir/res.out" 2>"$dir/res.err"
+ (
+ cd "$topdir"
+ $ucode_bin -e '{ "REQUIRE_SEARCH_PATH": [ "'"$topdir"'/*.so" ] }' -i - <"$in" >"$dir/res.out" 2>"$dir/res.err"
+ )
touch "$dir/empty"
printf "%d\n" $? > "$dir/res.code"
@@ -163,7 +169,7 @@ use_test() {
return 1
}
-for catdir in [0-9][0-9]_*; do
+for catdir in "$testdir/"[0-9][0-9]_*; do
[ -d "$catdir" ] || continue
printf "\n##\n## Running %s tests\n##\n\n" "${catdir##*/[0-9][0-9]_}"