[Genabel-commits] r1874 - in pkg/OmicABELnoMM: examples tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Oct 29 18:08:34 CET 2014
Author: lckarssen
Date: 2014-10-29 18:08:33 +0100 (Wed, 29 Oct 2014)
New Revision: 1874
Removed:
pkg/OmicABELnoMM/examples/results/
Modified:
pkg/OmicABELnoMM/tests/Makefile.am
pkg/OmicABELnoMM/tests/test.cpp
Log:
Fixed OmicABELnoMM's problems with running the tests in 'make distcheck'.
This change removes the (empty) examples/results directory. tests/Makefile.am creates tests/results now, just before running the checks.
In tests/test.cpp I've changed the hard coded output directory from 'examples/results' to 'tests/results'. For the input files I've prepended the DATADIR macro to the file paths, to be replaced/filled in by a -D DATADIR= preprocessing opton. If the -D DATADIR option is not specified test.cpp will look in the examples/ directory.
Note, a "pure" 'make distcheck' still doesn't work because of problems building the documentation. Run it like this for now:
DISTCHECK_CONFIGURE_FLAGS="--disable-latex-doc" make distcheck
Modified: pkg/OmicABELnoMM/tests/Makefile.am
===================================================================
--- pkg/OmicABELnoMM/tests/Makefile.am 2014-10-29 12:41:15 UTC (rev 1873)
+++ pkg/OmicABELnoMM/tests/Makefile.am 2014-10-29 17:08:33 UTC (rev 1874)
@@ -3,26 +3,32 @@
-## Stuff needed for the checks in the tests/ directory
+## Stuff needed for the checks in the tests/ directory. The DATADIR
+## variable is used to tell the test program where to find the source
+## files. In a VPATH build (e.g. when running 'make distcheck') the
+## $(srcdir) variable is set to the correct location.
check_PROGRAMS = tests/test_omicabelnomm
+tests_test_omicabelnomm_CPPFLAGS = -DDATADIR=\"$(srcdir)/\" $(AM_CPPFLAGS)
if USE_MPI
-tests_test_omicabelnomm_CXXFLAGS = -DUSE_MPI $(AM_CXXFLAGS)
+tests_test_omicabelnomm_CPPFLAGS += -DUSE_MPI
endif
-# List the sources for the test binary. Also include the empty
-# directory for the results, so that it gets included in the tar-ball
-# when running 'make dist'. Otherwise running 'make check' fails if
-# run by the user (since the test program doesn't check for the
-# directory's existence).
-testresultsdir = $(exmpldir)/results
+# List the sources for the test binary.
tests_test_omicabelnomm_SOURCES = \
$(oanomm_headers) \
$(oanomm_cpp) \
- $(testresultsdir) \
tests/test.cpp
+# List of programs to run when running 'make check'
TESTS = $(check_PROGRAMS)
+## Create the directory where the test results will be stored before
+## running the tests
+testresultsdir = tests/results
+AM_TESTS_ENVIRONMENT = \
+ $(MKDIR_P) $(testresultsdir);
+
+# Files created by the test programs need to be cleaned up.
cleanfiles_tests = $(testresultsdir)/dosages__dis.txt \
$(testresultsdir)/dosages_add__dis.txt \
$(testresultsdir)/dosages_dom__dis.txt \
Modified: pkg/OmicABELnoMM/tests/test.cpp
===================================================================
--- pkg/OmicABELnoMM/tests/test.cpp 2014-10-29 12:41:15 UTC (rev 1873)
+++ pkg/OmicABELnoMM/tests/test.cpp 2014-10-29 17:08:33 UTC (rev 1874)
@@ -167,10 +167,10 @@
#endif
params.r = 2;
- params.fnameOutFiles = "examples/results/normal";
- params.fnameAL = "examples/XL";
- params.fnameAR = "examples/XR";
- params.fnameY = "examples/Y";
+ params.fnameOutFiles = "tests/results/normal";
+ params.fnameAL = DATADIR "examples/XL";
+ params.fnameAR = DATADIR "examples/XR";
+ params.fnameY = DATADIR "examples/Y";
params.limit_t = 1000;
params.limit_m = params.limit_t * params.r;
@@ -189,20 +189,20 @@
//!-------------------------------------
//!-------------------------------------
//!interactions
- params.fnameOutFiles = "examples/results/normal";
- params.fnameAL = "examples/interactions/XL";
- params.fnameAR = "examples/interactions/XR";
- params.fnameY = "examples/interactions/Y";
+ params.fnameOutFiles = "tests/results/normal";
+ params.fnameAL = DATADIR "examples/interactions/XL";
+ params.fnameAR = DATADIR "examples/interactions/XR";
+ params.fnameY = DATADIR "examples/interactions/Y";
params.use_interactions = true;
params.r = 2;
params.limit_t = 50;
params.limit_m = params.limit_t * params.r;
// params.limit_n = 1000;
- params.fname_excludelist = "examples/exclude_individuals.txt";
- string source_path = "examples/interactions/INT";
- string out_path[] = {"examples/results/single_inter_",
- "examples/results/multi_inter_"};
+ params.fname_excludelist = DATADIR "examples/exclude_individuals.txt";
+ string source_path = DATADIR "examples/interactions/INT";
+ string out_path[] = {"tests/results/single_inter_",
+ "tests/results/multi_inter_"};
string out_keep[] = {"", "keep_"};
string dosagename[] = {"", "add_", "dom_", "res_", "mylin_", "myadd_"};
int dosage_r[] = {1, 2, 2, 2, 1, 2};
@@ -236,7 +236,7 @@
params.dosages = d;
params.model = d - 1;
params.r = dosage_r[d];
- params.fname_dosages = "examples/dosages_";
+ params.fname_dosages = DATADIR "examples/dosages_";
params.fname_dosages += std::to_string(params.r);
params.fname_dosages += ".txt";
@@ -314,21 +314,21 @@
//!-------------------------------------
//!dosages alone
//!-------------------------------------
- string out_dos_path[] = {"examples/results/dosages_",
- "examples/results/dosages_excl_"};
+ string out_dos_path[] = {"tests/results/dosages_",
+ "tests/results/dosages_excl_"};
for (int j = 0; j < 2; j++)
{
params.fname_excludelist = "";
if (j)
- params.fname_excludelist = "examples/exclude_individuals.txt";
+ params.fname_excludelist = DATADIR "examples/exclude_individuals.txt";
for (int d = 0; d < 6; d++)
{
params.dosages = d;
params.model = d-1;
params.r = dosage_r[d];
- params.fname_dosages = "examples/dosages_";
+ params.fname_dosages = DATADIR "examples/dosages_";
params.fname_dosages += std::to_string(params.r);
params.fname_dosages += ".txt";
More information about the Genabel-commits
mailing list