From d2070f8145e807a0d86816143fda3ea517caccb7 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Tue, 9 Oct 2018 12:40:31 +0100 Subject: [PATCH] splitting unittests --- Makefile.am | 18 ++++++++++++------ src/dEploidIO.cpp | 3 +-- src/dEploidIO.hpp | 1 + 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1d3e4887..f25ad9e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,8 +11,8 @@ bin_PROGRAMS = dEploid dEploid_dbg utilities man1_MANS = docs/_build/man/dEploid.1 -TESTS = unit_tests -check_PROGRAMS = unit_tests dEploid_dbg dEploid_prof +TESTS = unit_tests io_unit_tests +check_PROGRAMS = unit_tests dEploid_dbg dEploid_prof io_unit_tests PROG = DEPLOID common_flags = -std=c++0x -Isrc/ -Isrc/codeCogs/ -Isrc/random/ -Isrc/gzstream/ -Isrc/lasso/ -DDEPLOIDVERSION=\"${DEPLOIDVERSION}\" -DCOMPILEDATE=\"${COMPILEDATE}\" @@ -54,19 +54,25 @@ dEploid_prof_LDADD = $(common_LDADD) unit_tests_SOURCES = $(common_src) \ tests/unittest/test_runner.cpp \ - tests/unittest/test_dEploidIO.cpp \ tests/unittest/test_ibd.cpp \ tests/unittest/test_updateSingleHap.cpp \ tests/unittest/test_utilities.cpp \ tests/unittest/test_panel.cpp \ - tests/unittest/test_txtReader.cpp \ tests/unittest/test_mcmc.cpp \ - tests/unittest/test_updatePairHap.cpp \ - tests/unittest/test_vcfReader.cpp + tests/unittest/test_updatePairHap.cpp unit_tests_CXXFLAGS = $(common_flags) -DNDEBUG -DUNITTEST -Wno-write-strings --coverage unit_tests_LDADD = -lcppunit -ldl $(common_LDADD) +io_unit_tests_SOURCES = $(common_src) \ + tests/unittest/test_runner.cpp \ + tests/unittest/test_dEploidIO.cpp \ + tests/unittest/test_txtReader.cpp \ + tests/unittest/test_vcfReader.cpp + +io_unit_tests_CXXFLAGS = $(common_flags) -DNDEBUG -DUNITTEST -Wno-write-strings --coverage +io_unit_tests_LDADD = -lcppunit -ldl $(common_LDADD) + clean-local: clean-local-check .PHONY: clean-local-check utilities clean-local-check: diff --git a/src/dEploidIO.cpp b/src/dEploidIO.cpp index a8edbe7a..23fe8ad0 100644 --- a/src/dEploidIO.cpp +++ b/src/dEploidIO.cpp @@ -822,8 +822,7 @@ void DEploidIO::dEploidLasso() { vector < vector > tmpPanel = lassoSubsetPanel(start, length); DEploidLASSO dummy(tmpPanel, wsaf, 250); lassoPanels.push_back(dummy.reducedPanel); - - + lassoPlafs.push_back(vector (plaf_.begin()+start, plaf_.begin()+start+length)); // for (size_t i = 0; i < dummy.choiceIdx.size(); i++) { // cout << dummy.choiceIdx[i] << " " ; diff --git a/src/dEploidIO.hpp b/src/dEploidIO.hpp index 47a752b3..7986e337 100644 --- a/src/dEploidIO.hpp +++ b/src/dEploidIO.hpp @@ -174,6 +174,7 @@ class DEploidIO{ // Lasso Related vector < vector < vector > > lassoPanels; + vector < vector > lassoPlafs; // Parameters double missCopyProb_;