diff options
author | Pjotr Prins | 2017-07-09 07:38:29 +0000 |
---|---|---|
committer | Pjotr Prins | 2017-07-09 07:38:29 +0000 |
commit | e0671a336595deddaa287a1f1f4f718897d01b90 (patch) | |
tree | 201a1fc6cc8a194e04651804cb0027c1844cfd7f | |
parent | 1311f55dd359036f5e2ddf83784ce54c8dff3cd7 (diff) | |
download | pangemma-e0671a336595deddaa287a1f1f4f718897d01b90.tar.gz |
Add test framework based on shunit2
-rwxr-xr-x | run_tests.sh | 7 | ||||
-rwxr-xr-x | test/test_suite.sh | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..e8b7d49 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# download shunit2 in order to run tests: +# curl -L "https://dl.dropboxusercontent.com/u/7916095/shunit2-2.0.3.tgz" | tar zx --overwrite + +cd test +./test_suite.sh | tee /dev/stderr | grep -q 'success rate: 100%' diff --git a/test/test_suite.sh b/test/test_suite.sh new file mode 100755 index 0000000..c6aa38e --- /dev/null +++ b/test/test_suite.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +gemma=../bin/gemma + +testCenteredRelatednessMatrix() { + $gemma -g ../example/mouse_hs1940.geno.txt.gz -p ../example/mouse_hs1940.pheno.txt \ + -a ../example/mouse_hs1940.anno.txt -gk -o mouse_hs1940 + assertEquals "3763600" `wc -w < output/mouse_hs1940.cXX.txt` +} + +shunit2=`which shunit2` +if [ -x "$shunit2" ]; then + . $shunit2 +else + # try to run the locally installed shunit2 + . ../shunit2-2.0.3/src/shell/shunit2 +fi |