aboutsummaryrefslogtreecommitdiffstats
path: root/res/check_ck
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-09-16 15:27:31 +0300
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-09-16 15:27:31 +0300
commitaf17ead850f90cf6e4476aa74975e68d7293fb27 (patch)
tree8e2db1f5feae9b25cf5294ea635378f444d295c7 /res/check_ck
parent0f33c8a9cbabda257c4dd73009266a4cf5f857a7 (diff)
downloadck-af17ead850f90cf6e4476aa74975e68d7293fb27.tar.gz
ck-af17ead850f90cf6e4476aa74975e68d7293fb27.tar.bz2
ck-af17ead850f90cf6e4476aa74975e68d7293fb27.zip
Add unit test infrastructure
Diffstat (limited to 'res/check_ck')
-rwxr-xr-xres/check_ck31
1 files changed, 29 insertions, 2 deletions
diff --git a/res/check_ck b/res/check_ck
index 6e61e5c..ce35396 100755
--- a/res/check_ck
+++ b/res/check_ck
@@ -3,10 +3,12 @@
BIN=@CMAKE_BINARY_DIR@
TEST_LOCATION=@PROJECT_TESTING_GROUNDS@
+# used in regression tests
function running {
echo "--[TESTING $1]--"
}
+# used in regression tests
function init {
running $1
mkdir -p $TEST_LOCATION/vc
@@ -23,7 +25,17 @@ function clear_tests {
rm -rf $TEST_LOCATION
}
-function run {
+function unit_tests {
+ echo -e "################################"
+ echo -e "########## Unit Tests ##########"
+ echo -e "################################"
+ ./ck-test
+}
+
+function regression_tests {
+ echo -e "######################################"
+ echo -e "########## Regression Tests ##########"
+ echo -e "######################################"
DIR=@BIN_TESTS_DIR@
for i in $( ls $DIR ); do
ERROR="TEST "$i" FAILED:"
@@ -33,10 +45,17 @@ function run {
done
}
+function run {
+ unit_tests
+ regression_tests
+}
+
function print_help {
echo -e "ck test suite"
- echo -e "run without flags to begin testing"
+ echo -e "use without flags to run all tests"
echo -e "\nflags:"
+ echo -e " -u, --unit\t\trun only the unit tests"
+ echo -e " -r, --regression\trun only the regression tests"
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"
@@ -58,6 +77,14 @@ do
clear_tests
exit
;;
+ -u | --unit)
+ unit_tests
+ exit
+ ;;
+ -r | --regression)
+ regression_tests
+ exit
+ ;;
*) # unknown option
print_help
exit