From 3f3ed99c0d4a42cf7ba87144cb2c6967c9c2fdab Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Sat, 18 Mar 2017 03:37:51 +0100
Subject: [PATCH] Add test/README: shell file self-documented

---
 .gitignore      |  1 +
 pkg/DESCRIPTION |  2 +-
 test/Makefile   |  8 ++++----
 test/README     | 30 ++++++++++++++++++++++++++++++
 4 files changed, 36 insertions(+), 5 deletions(-)
 create mode 100644 test/README

diff --git a/.gitignore b/.gitignore
index 3a96875..d52ee00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
 #ignore temporary files
 *~
 *.swp
+*.Rout
 
 #ignore R session files + RStudio files
 .Rhistory
diff --git a/pkg/DESCRIPTION b/pkg/DESCRIPTION
index 5a8bc18..d3841a7 100644
--- a/pkg/DESCRIPTION
+++ b/pkg/DESCRIPTION
@@ -28,4 +28,4 @@ Suggests:
 URL: http://git.auder.net/?p=valse.git
 License: MIT + file LICENSE
 VignetteBuilder: knitr
-RoxygenNote: 5.0.1
+RoxygenNote: 6.0.1
diff --git a/test/Makefile b/test/Makefile
index 26d9bc6..0fa1189 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,11 +1,11 @@
 CC = gcc
 CFLAGS = -g -std=gnu99 -Wno-implicit-function-declaration
-LDFLAGS = -lm -lgsl -lcblas -lgomp
+LDFLAGS = -lm -lgsl -lcblas
 TEST_LDFLAGS = -L. libvalse_core.so
 LIB = libvalse_core.so
-LIB_SRC = $(wildcard ../sources/*.c)
+LIB_SRC = $(wildcard ../pkg/src/sources/*.c)
 LIB_OBJ = $(LIB_SRC:.c=.o)
-INCLUDES = -I../sources
+INCLUDES = -I../pkg/src/sources
 TESTS = test.EMGLLF test.EMGrank test.constructionModelesLassoMLE test.EMGrank\
         test.constructionModelesLassoRank test.selectionTotale
 
@@ -33,7 +33,7 @@ test.selectionTotale: $(LIB) test.selectionTotale.o test_utils.o
 	$(CC) -fPIC -o $@ -c $< $(CFLAGS) $(INCLUDES)
 
 clean:
-	rm -f *.o ../sources/*.o ../adapters/*.o
+	rm -f *.o ../pkg/src/sources/*.o ../pkg/src/adapters/*.o
 
 cclean: clean
 	rm -f *.so $(TESTS)
diff --git a/test/README b/test/README
new file mode 100644
index 0000000..32fcb6d
--- /dev/null
+++ b/test/README
@@ -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.
-- 
2.44.0