about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_suite.sh30
1 files changed, 14 insertions, 16 deletions
diff --git a/test/test_suite.sh b/test/test_suite.sh
index d1dbb3c..ebbe4c7 100755
--- a/test/test_suite.sh
+++ b/test/test_suite.sh
@@ -8,11 +8,11 @@ testCenteredRelatednessMatrixK() {
     assertEquals 0 $?
     grep "total computation time" < output/mouse_hs1940.log.txt
     assertEquals 0 $?
-    assertEquals "3763600" `wc -w < output/mouse_hs1940.cXX.txt`
-    # assertEquals "15f680c" `md5sum < output/mouse_hs1940.cXX.txt | head -c 7`
-    assertEquals "0.335" `head -c 5 output/mouse_hs1940.cXX.txt`
-    # FIXME: The following test fails in the Guix build system (https://github.com/xiangzhou/GEMMA/issues/55)
-    assertEquals "24.9799" `awk '{s+=substr($1,0,6)}END{print s}' output/mouse_hs1940.cXX.txt`
+    outfn=output/mouse_hs1940.cXX.txt
+    assertEquals "1940" `wc -l < $outfn`
+    assertEquals "3763600" `wc -w < $outfn`
+    assertEquals "0.335" `head -c 5 $outfn`
+    assertEquals "24.9799" `perl -nle '$sum += substr($_,0,6) } END { print $sum' $outfn`
 }
 
 testUnivariateLinearMixedModel() {
@@ -22,8 +22,9 @@ testUnivariateLinearMixedModel() {
     assertEquals 0 $?
     grep "total computation time" < output/mouse_hs1940_CD8_lmm.log.txt
     assertEquals 0 $?
-    assertEquals "118459" `wc -w < output/mouse_hs1940_CD8_lmm.assoc.txt`
-    assertEquals "92047" `awk '{s+=substr($1,0,6)}END{print s}' output/mouse_hs1940_CD8_lmm.assoc.txt`
+    outfn=output/mouse_hs1940_CD8_lmm.assoc.txt
+    assertEquals "118459" `wc -w < $outfn`
+    assertEquals "92047" `perl -nle '$sum += substr($_,0,6) } END { print $sum' $outfn`
 }
 
 testMultivariateLinearMixedModel() {
@@ -36,19 +37,16 @@ testMultivariateLinearMixedModel() {
 
     outfn=output/mouse_hs1940_CD8MCH_lmm.assoc.txt
     assertEquals "139867" `wc -w < $outfn`
-    assertEquals "92079" `awk '{s+=substr($1,0,6)}END{print s}' $outfn`
+    assertEquals "92079" `perl -nle '$sum += substr($_,0,6) } END { print $sum' $outfn`
 }
-
 shunit2=`which shunit2`
-if [ -e "../contrib/shunit2/source/2.0/src/shell/shunit2" ]; then
-    echo try to run the locally installed shunit2
-    . ../contrib/shunit2/source/2.0/src/shell/shunit2
-elif [ -e "shunit2-2.0.3/src/shell/shunit2" ]; then
-    echo try to run the older locally installed shunit2
-    . shunit2-2.0.3/src/shell/shunit2
-elif [ -x "$shunit2" ]; then
+
+if [ -x "$shunit2" ]; then
     echo run system shunit2
     . $shunit2
+elif [ -e shunit2-2.0.3/src/shell/shunit2 ]; then
+    echo run shunit2 provided in gemma repo
+    . shunit2-2.0.3/src/shell/shunit2
 else
     echo "Can not find shunit2 - see INSTALL.md"
 fi