Skip to content

Commit

Permalink
includ eunit test
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu committed Jan 10, 2021
1 parent 6e7b8d4 commit 30884ce
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ unit_tests_SOURCES = $(common_src) \
tests/unittest/test_utilities.cpp \
tests/unittest/test_panel.cpp \
tests/unittest/test_mcmc.cpp \
tests/unittest/test_updatePairHap.cpp
tests/unittest/test_updatePairHap.cpp \
tests/unittest/test_workflow.cpp

unit_tests_CXXFLAGS = $(common_flags) -DNDEBUG -DUNITTEST -Wno-write-strings --coverage
unit_tests_LDADD = -lcppunit -ldl $(common_LDADD)
Expand All @@ -79,7 +80,7 @@ io_unit_tests_LDADD = -lcppunit -ldl $(common_LDADD)

current_unit_tests_SOURCES = $(common_src) \
tests/unittest/test_runner.cpp \
tests/unittest/test_mcmc.cpp
tests/unittest/test_workflow.cpp

current_unit_tests_CXXFLAGS = $(common_flags) -DNDEBUG -DUNITTEST -Wno-write-strings --coverage
current_unit_tests_LDADD = -lcppunit -ldl $(common_LDADD)
Expand Down
56 changes: 56 additions & 0 deletions tests/unittest/test_workflow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* dEploid is used for deconvoluting Plasmodium falciparum genome from
* mix-infected patient sample.
*
* Copyright (C) 2016-2018 University of Oxford
*
* Author: Sha (Joe) Zhu
*
* This file is part of dEploid.
*
* dEploid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#include <cppunit/TestCase.h>
#include <cppunit/extensions/HelperMacros.h>
#include "src/dEploidIO.hpp"

class TestWorkflow : public CppUnit::TestCase {
CPPUNIT_TEST_SUITE(TestWorkflow);
CPPUNIT_TEST(testWorkflowBest);
CPPUNIT_TEST_SUITE_END();

public:
void setUp() {
}

void tearDown() {
}

void testWorkflowBest(){
char *argv1[] = { "./dEploid",
"-vcf", "data/testData/PG0390-C.test.vcf.gz",
"-sample", "PG0390-C", "-plafFromVcf",
"-exclude", "data/testData/labStrains.test.exclude.txt.gz"
"-panel", "data/testData/labStrains.test.panel.txt.gz",
"-best"};
DEploidIO tmp(11, argv1);
CPPUNIT_ASSERT_NO_THROW(tmp.workflow_best());

}
};

CPPUNIT_TEST_SUITE_REGISTRATION(TestWorkflow);

0 comments on commit 30884ce

Please sign in to comment.