Add test/README: shell file self-documented
[valse.git] / test / README
diff --git a/test/README b/test/README
new file mode 100644 (file)
index 0000000..32fcb6d
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#Testing procedure for EMGLLF (inside this folder):
+
+#0) Install current version of the package
+    # Should be library(roxygen2);roxygenize('.'), but roxygen2 6.0.1 bug
+    # ==> temporary workaround with devtools + document()
+    echo "setwd('../pkg');library(devtools);document()" | R --slave
+    R CMD INSTALL ../pkg
+
+#1) Generate data using R versions of EMGLLF/EMGrank (slow, but trusted)
+    cd generate_test_data/
+    echo "source('generateRunSaveTest_EMGLLF.R');\
+      # I'm happy with default values - feel free to give args
+      generateRunSaveTest_EMGLLF() "\
+      | R --slave
+
+#2) Compile test C code
+               # Next line might be required sometimes, to destroy all .o and .so
+    make cclean
+               # Next line compile the test into an executable named "test.EMGLLF"
+    make test.EMGLLF
+
+#3) Run it!
+    # Fingers crossed, hoping everything is alright
+    ./test.EMGLLF
+               # Ask valgrind (generally better idea ;) )
+               valgrind ./test.EMGLLF
+
+#For EMGrank: same procedure, just change EMGLLF to EMGrank everwhere.