about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/runner16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/runner b/test/runner
index ad5b381..1748692 100755
--- a/test/runner
+++ b/test/runner
@@ -5,7 +5,10 @@ exec guile --debug -s "$0" "$@"
 
 (define-module (test-runner)
   #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1) ; for last
+  #:use-module (srfi srfi-13)
   #:use-module (srfi srfi-64)
+  #:use-module (ice-9 rdelim)
   )
 
 (test-begin "runner")
@@ -21,4 +24,17 @@ exec guile --debug -s "$0" "$@"
 ;; Finish the testsuite, and report results.
 (test-end "vec-test")
 
+(test-begin "external-gemma-run")
+(let [(err (system "./build/bin/Debug/gemma -g ./example/mouse_hs1940.geno.txt.gz -p ./example/mouse_hs1940.pheno.txt -gk -o mouse_hs1940 -debug"))]
+  (test-eqv 0 err))
+(let [(err (system "./build/bin/Debug/gemma -g ./example/mouse_hs1940.geno.txt.gz -p ./example/mouse_hs1940.pheno.txt -n 1 -a ./example/mouse_hs1940.anno.txt -k ./output/mouse_hs1940.cXX.txt -o mouse_hs1940 -lmm 9 -debug"))]
+  (test-eqv 0 err))
+(call-with-input-file "output/mouse_hs1940.assoc.txt"
+  (lambda (port)
+    (read-line port)  ; skip first line
+    (let* ((fields (string-split (read-line port) #\tab))
+           (last-field (last fields)))
+      (test-eqv 208.0 (truncate (* 1000 (string->number last-field)))))))
+(test-end "external-gemma-run")
+
 (test-end "runner")