summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2026-10-06 11:08:52 +0100
committerdavidovski <david@davidovski.xyz>2026-10-06 11:08:52 +0100
commit41cfdcbb58a946718e7c665e8d3600e41ebb0bd3 (patch)
treeebf63ffd3b76ee9ea158f54c6cd3949b7674b6ba
parenteca55e60c29440c4e2e007b54ea1a1983e965954 (diff)
add pre and post test to shtestsHEADmaster
-rw-r--r--src/util/shtests.sh5
-rwxr-xr-xtest/parseconf.sh2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/util/shtests.sh b/src/util/shtests.sh
index 44ad48e..fbd15b6 100644
--- a/src/util/shtests.sh
+++ b/src/util/shtests.sh
@@ -20,6 +20,9 @@ runtest () {
test_name=$(echo $1 | sed "s/_/ /g")
test_func="$2"
printf "${BLUE}[ ] ${RESET}$test_name ";
+
+ command -v pre_test > /dev/null 2>&1 && pre_test
+
if "$test_func" ; then
printf "\r$PASS\n"
return 0
@@ -27,6 +30,8 @@ runtest () {
printf "\r$FAIL\n"
return 1
fi
+
+ command -v post_test > /dev/null 2>&1 && post_test
}
# TODO use getopt for this
diff --git a/test/parseconf.sh b/test/parseconf.sh
index 6eb50dc..7e83397 100755
--- a/test/parseconf.sh
+++ b/test/parseconf.sh
@@ -1,4 +1,4 @@
-#!/bin/shtests
+#!/usr/bin/env shtests
PARSECONF="./dist/parseconf"
SIMPLECONF="./test/simple.conf"