aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-04-30 17:23:00 +0300
committergramanas <anastasis.gramm2@gmail.com>2018-04-30 17:23:00 +0300
commitfdc979dafba2e12d2dc3d46de3b946d6943ed4a3 (patch)
treec31d046362988b682de3e9f661a466f6395ff66d /res
parentd40a31f3e1a16e30b46edfd8e903c92afa3d7124 (diff)
downloadck-fdc979dafba2e12d2dc3d46de3b946d6943ed4a3.tar.gz
ck-fdc979dafba2e12d2dc3d46de3b946d6943ed4a3.tar.bz2
ck-fdc979dafba2e12d2dc3d46de3b946d6943ed4a3.zip
More test optimisations
Diffstat (limited to 'res')
-rwxr-xr-xres/check_ck49
1 files changed, 40 insertions, 9 deletions
diff --git a/res/check_ck b/res/check_ck
index fbb5ef7..6e61e5c 100755
--- a/res/check_ck
+++ b/res/check_ck
@@ -23,15 +23,46 @@ function clear_tests {
rm -rf $TEST_LOCATION
}
-if [ "$1" = "-c" ]; then
- clear_tests
- exit 0
+function run {
+ DIR=@BIN_TESTS_DIR@
+ for i in $( ls $DIR ); do
+ ERROR="TEST "$i" FAILED:"
+ PASS="--[TEST "$i" PASSED]--\n"
+ source $DIR/$i
+ wait $!
+ done
+}
+
+function print_help {
+ echo -e "ck test suite"
+ echo -e "run without flags to begin testing"
+ echo -e "\nflags:"
+ echo -e " -c, --clear\t\tremove test files"
+ echo -e " \t\t use it if the tests fail"
+ echo -e " -h, --help, *\t\tprint this"
+ exit
+}
+
+if [[ $# -gt 1 ]]; then
+ print_help
fi
-DIR=@BIN_TESTS_DIR@
-for i in $( ls $DIR ); do
- ERROR="TEST "$i" FAILED:"
- PASS="--[TEST "$i" PASSED]--\n"
- source $DIR/$i
- wait $!
+while [[ $# -gt 0 ]]
+do
+ key="$1"
+ case $key in
+ -h | --help)
+ print_help
+ ;;
+ -c | --clear)
+ clear_tests
+ exit
+ ;;
+ *) # unknown option
+ print_help
+ exit
+ ;;
+ esac
done
+
+run