aboutsummaryrefslogtreecommitdiffstats
path: root/res/test-ck
diff options
context:
space:
mode:
Diffstat (limited to 'res/test-ck')
-rwxr-xr-xres/test-ck24
1 files changed, 17 insertions, 7 deletions
diff --git a/res/test-ck b/res/test-ck
index 647f43d..a7a7cf8 100755
--- a/res/test-ck
+++ b/res/test-ck
@@ -2,9 +2,12 @@
BIN=$(realpath @CMAKE_BINARY_DIR@) # solve symlink problems
TEST_LOCATION=$(realpath @PROJECT_TESTING_GROUNDS@)
+V=3
# used in regression tests
function running {
+ # open devnul in fd 3
+ exec 3<> /dev/null
echo "[$COUNT/$TOTAL] testing $1"
((++COUNT))
}
@@ -29,7 +32,13 @@ function add_config {
fi
}
+function set_verbose {
+ V=1;
+}
+
function clear_tests {
+ # close fd
+ exec 3>&-
rm $BIN/ckrc
rm $BIN/ckdb
rm $BIN/test*.conf
@@ -75,6 +84,7 @@ function print_help {
echo -e " -r, --regression\trun only the regression tests"
echo -e " -c, --clear\t\tremove test files"
echo -e " \t\t use if the tests crush unexpectedly"
+ echo -e " -v, --verbose\t\tverbose test output"
echo -e " -h, --help, *\t\tprint this"
exit
}
@@ -87,10 +97,7 @@ while [[ $# -gt 0 ]]
do
key="$1"
case $key in
- -h | --help)
- print_help
- ;;
- -c | --clear)
+ -c | --clear)
clear_tests
exit
;;
@@ -102,11 +109,14 @@ do
regression_tests
exit
;;
- *) # unknown option
+ -v | --verbose)
+ set_verbose
+ shift
+ ;;
+ -h | --help | *)
print_help
- exit
;;
- esac
+ esac
done
run