diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-11-16 15:18:52 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-11-16 15:18:52 +0200 |
commit | 2919a5e2c1d33d170bffc93dfeaa6292b9fa3dca (patch) | |
tree | f40fe47da44ae371b20149940ad096e894a708bb /res/test-ck | |
parent | 54ae271dfc5f8405233ed320b2e9bd821ee8210f (diff) | |
download | ck-2919a5e2c1d33d170bffc93dfeaa6292b9fa3dca.tar.gz ck-2919a5e2c1d33d170bffc93dfeaa6292b9fa3dca.tar.bz2 ck-2919a5e2c1d33d170bffc93dfeaa6292b9fa3dca.zip |
Add verbose option to regression tests
Diffstat (limited to 'res/test-ck')
-rwxr-xr-x | res/test-ck | 24 |
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 |