Commit 9592f8c7 authored by Luka Vretenar's avatar Luka Vretenar Committed by Vedran Miletić

Ported all unit tests to GoogleTest

parent 7d64bb9c
......@@ -29,8 +29,8 @@ Make sure you have the following packages installed:
- gcc GNU C compiler (or your preferred C compiler)
- g++ GNU C++ compiler (or your preferred C++ compiler)
- make
- cppunit C++ unit testing framework (port of JUnit)
- cppunit-devel C++ unit testing framework (port of JUnit)
- googletest Google's C++ test framework
- libgtest-dev Google's framework for writing C++ tests
After installing these dependencies, please follow the following steps:
......
......@@ -29,8 +29,8 @@ Make sure you have the following packages installed:
- gcc GNU C compiler (or your preferred C compiler)
- g++ GNU C++ compiler (or your preferred C++ compiler)
- make
- cppunit C++ unit testing framework (port of JUnit)
- cppunit-devel C++ unit testing framework (port of JUnit)
- googletest Google's C++ test framework
- libgtest-dev Google's framework for writing C++ tests
After installing these dependencies, please follow the following steps:
......
#include "RbtConfig.h"
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
#include "RbtDebug.h"
#include <gtest/gtest.h>
const std::string EXEVERSION = " ($Id$)";
int main(int argc, char **argv) {
std::string strExeName(argv[0]);
Rbt::PrintStdHeader(std::cout, strExeName + EXEVERSION);
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry &registry =
CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest(registry.makeTest());
runner.run();
_RBTOBJECTCOUNTER_DUMP_(std::cout)
return 0;
::testing::InitGoogleTest(&argc, argv);
int rc = RUN_ALL_TESTS();
_RBTOBJECTCOUNTER_DUMP_(cout)
return rc;
}
......@@ -11,11 +11,9 @@
#include "RbtVariant.h"
#include "RbtVdwIdxSF.h"
CPPUNIT_TEST_SUITE_REGISTRATION(OccupancyTest);
double OccupancyTest::TINY = 1E-4;
void OccupancyTest::setUp() {
void OccupancyTest::SetUp() {
try {
// Create the docking site, receptor, and ligand objects
const std::string &wsName = "1YET";
......@@ -41,12 +39,14 @@ void OccupancyTest::setUp() {
}
}
void OccupancyTest::tearDown() {
void OccupancyTest::TearDown() {
m_workSpace.SetNull();
m_solventList.clear();
}
void OccupancyTest::testSolvationSF() {
// 1) Check that the total desolvation score for receptor / ligand / (disabled)
// solvent matches the total score with no solvent present
TEST_F(OccupancyTest, SolvationSF) {
RbtBaseSF *sfAgg = new RbtSFAgg("SCORE");
RbtBaseSF *sfInter = new RbtSFAgg("INTER");
RbtBaseSF *sfSolv = new RbtSAIdxSF("SOLV");
......@@ -54,10 +54,12 @@ void OccupancyTest::testSolvationSF() {
sfInter->Add(sfSolv);
m_workSpace->SetSF(sfAgg);
CPPUNIT_ASSERT(CompareScoresForDisabledAndNoSolvent() < TINY);
ASSERT_LT(CompareScoresForDisabledAndNoSolvent(), TINY);
}
void OccupancyTest::testPolarSF() {
// 2) Check that the total polar score for receptor / ligand / (disabled)
// solvent matches the total score with no solvent present
TEST_F(OccupancyTest, PolarSF) {
RbtBaseSF *sfAgg = new RbtSFAgg("SCORE");
RbtBaseSF *sfInter = new RbtSFAgg("INTER");
RbtBaseSF *sfSetupPolar = new RbtSetupPolarSF("SETUP");
......@@ -71,10 +73,12 @@ void OccupancyTest::testPolarSF() {
sfInter->Add(sfPolar);
m_workSpace->SetSF(sfAgg);
CPPUNIT_ASSERT(CompareScoresForDisabledAndNoSolvent() < TINY);
ASSERT_LT(CompareScoresForDisabledAndNoSolvent(), TINY);
}
void OccupancyTest::testVdwSF() {
// 3) Check that the total vdW score for receptor / ligand / (disabled) solvent
// matches the total score with no solvent present
TEST_F(OccupancyTest, VdwSF) {
RbtBaseSF *sfAgg = new RbtSFAgg("SCORE");
RbtBaseSF *sfInter = new RbtSFAgg("INTER");
RbtBaseSF *sfVdw = new RbtVdwIdxSF("VDW");
......@@ -82,10 +86,10 @@ void OccupancyTest::testVdwSF() {
sfInter->Add(sfVdw);
m_workSpace->SetSF(sfAgg);
CPPUNIT_ASSERT(CompareScoresForDisabledAndNoSolvent() < TINY);
ASSERT_LT(CompareScoresForDisabledAndNoSolvent(), TINY);
}
void OccupancyTest::testVdwSFSolventModes() {
TEST_F(OccupancyTest, VdwSFSolventModes) {
RbtBaseSF *sfAgg = new RbtSFAgg("SCORE");
RbtBaseSF *sfInter = new RbtSFAgg("INTER");
RbtBaseSF *sfSystem = new RbtSFAgg("SYSTEM");
......@@ -96,10 +100,11 @@ void OccupancyTest::testVdwSFSolventModes() {
sfInter->Add(sfVdw);
m_workSpace->SetSF(sfAgg);
CPPUNIT_ASSERT(CompareScoresForSolventModes() < TINY);
ASSERT_LT(CompareScoresForSolventModes(), TINY);
}
void OccupancyTest::testFlexAtomFactoryReceptor() {
// 5) Checks the results of RbtFlexAtomFactory for receptor flexibility modes
TEST_F(OccupancyTest, FlexAtomFactoryReceptor) {
int expected[2][3] = {{2034, 10, 0}, {2044, 0, 0}};
RbtModelPtr spReceptor = m_workSpace->GetReceptor();
bool isTestOK = true;
......@@ -129,10 +134,11 @@ void OccupancyTest::testFlexAtomFactoryReceptor() {
isTestOK = false;
}
}
CPPUNIT_ASSERT(isTestOK);
ASSERT_TRUE(isTestOK);
}
void OccupancyTest::testFlexAtomFactorySolvent() {
// 6) Checks the results of RbtFlexAtomFactory for solvent flexibility modes
TEST_F(OccupancyTest, FlexAtomFactorySolvent) {
// Expected sizes for fixed, tethered and free atom lists
// for each value of model flexibility mode
int expected[9][3] = {{3, 0, 0}, {0, 3, 0}, {0, 3, 0}, {0, 3, 0}, {0, 3, 0},
......@@ -143,10 +149,11 @@ void OccupancyTest::testFlexAtomFactorySolvent() {
RbtModelPtr solvent = solventList.front();
isTestOK = testFlexAtomFactory(solventList.front(), expected);
}
CPPUNIT_ASSERT(isTestOK);
ASSERT_TRUE(isTestOK);
}
void OccupancyTest::testFlexAtomFactoryLigand() {
// 7) Checks the results of RbtFlexAtomFactory for ligand flexibility modes
TEST_F(OccupancyTest, FlexAtomFactoryLigand) {
// Expected sizes for fixed, tethered and free atom lists
// for each value of model flexibility mode
int expected[9][3] = {{0, 0, 44}, {0, 0, 44}, {0, 0, 44},
......@@ -157,7 +164,7 @@ void OccupancyTest::testFlexAtomFactoryLigand() {
if (!spLigand.Null()) {
isTestOK = testFlexAtomFactory(spLigand, expected);
}
CPPUNIT_ASSERT(isTestOK);
ASSERT_TRUE(isTestOK);
}
double OccupancyTest::CompareScoresForDisabledAndNoSolvent() {
......@@ -181,10 +188,6 @@ double OccupancyTest::CompareScoresForDisabledAndNoSolvent() {
}
m_workSpace->SetSolvent(m_solventList);
double scoreEnabledSolvent = pSF->Score();
std::cout << "Score no solvent = " << scoreNoSolvent << std::endl;
std::cout << "Score enabled solvent = " << scoreEnabledSolvent << std::endl;
std::cout << "Score disabled solvent = " << scoreDisabledSolvent
<< std::endl;
retVal = fabs(scoreNoSolvent - scoreDisabledSolvent);
}
return retVal;
......
......@@ -13,47 +13,18 @@
#ifndef OCCUPANCY_H_
#define OCCUPANCY_H_
#include <cppunit/extensions/HelperMacros.h>
#include <gtest/gtest.h>
#include "RbtBiMolWorkSpace.h"
#include "RbtModel.h"
class OccupancyTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(OccupancyTest);
CPPUNIT_TEST(testSolvationSF);
CPPUNIT_TEST(testPolarSF);
CPPUNIT_TEST(testVdwSF);
CPPUNIT_TEST(testVdwSFSolventModes);
CPPUNIT_TEST(testFlexAtomFactoryReceptor);
CPPUNIT_TEST(testFlexAtomFactorySolvent);
CPPUNIT_TEST(testFlexAtomFactoryLigand);
CPPUNIT_TEST_SUITE_END();
public:
class OccupancyTest : public ::testing::Test {
protected:
static double TINY;
// TextFixture methods
void setUp();
void tearDown();
void SetUp() override;
void TearDown() override;
// 1) Check that the total desolvation score for receptor / ligand /
// (disabled) solvent matches the total score with no solvent present
void testSolvationSF();
// 2) Check that the total polar score for receptor / ligand / (disabled)
// solvent matches the total score with no solvent present
void testPolarSF();
// 3) Check that the total vdW score for receptor / ligand / (disabled)
// solvent matches the total score with no solvent present
void testVdwSF();
void testVdwSFSolventModes();
// 5) Checks the results of RbtFlexAtomFactory for receptor flexibility modes
void testFlexAtomFactoryReceptor();
// 6) Checks the results of RbtFlexAtomFactory for solvent flexibility modes
void testFlexAtomFactorySolvent();
// 7) Checks the results of RbtFlexAtomFactory for ligand flexibility modes
void testFlexAtomFactoryLigand();
private:
// Helper functions
double CompareScoresForDisabledAndNoSolvent();
double CompareScoresForSolventModes();
......@@ -61,4 +32,5 @@ private:
RbtBiMolWorkSpacePtr m_workSpace;
RbtModelList m_solventList;
};
#endif /*OCCUPANCY_TEST_H_*/
This diff is collapsed.
......@@ -13,7 +13,7 @@
#ifndef RBTCHROMTEST_H_
#define RBTCHROMTEST_H_
#include <cppunit/extensions/HelperMacros.h>
#include <gtest/gtest.h>
#include "RbtBiMolWorkSpace.h"
#include "RbtChrom.h"
......@@ -21,58 +21,12 @@
#include "RbtModel.h"
#include "RbtSFAgg.h"
class RbtChromTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(RbtChromTest);
CPPUNIT_TEST(testChromFactory);
CPPUNIT_TEST(testCloneDestructor);
CPPUNIT_TEST(testCloneLengthEquals);
CPPUNIT_TEST(testChromOperatorEquals);
CPPUNIT_TEST(testChromOperatorEqualsAfterMutate);
CPPUNIT_TEST(testSyncToModel);
CPPUNIT_TEST(testSyncToModelAfterMutate);
CPPUNIT_TEST(testSyncToModelAfterReset);
CPPUNIT_TEST(testCloneReset);
CPPUNIT_TEST(testMutatedCloneReset);
CPPUNIT_TEST(testChromOperatorEqualsAfterRandomise);
CPPUNIT_TEST(testSyncToModelAfterRandomise);
CPPUNIT_TEST(testSyncToModelAfterRandomiseReset);
CPPUNIT_TEST(testChromOperatorEqualsAfterMutateReset);
CPPUNIT_TEST(testChromOperatorEqualsAfterRandomiseReset);
CPPUNIT_TEST(testNullCrossover);
CPPUNIT_TEST(testEuler);
CPPUNIT_TEST(testRepeatedSync);
CPPUNIT_TEST(testCompareWithNullChrom);
CPPUNIT_TEST(testCompareAfterMutate);
CPPUNIT_TEST(testOperatorEqualsWithModifiedThreshold);
CPPUNIT_TEST(testPopulationConstructor);
CPPUNIT_TEST_EXCEPTION(testPopulationConstructorZeroSize, RbtBadArgument);
CPPUNIT_TEST_EXCEPTION(testPopulationConstructorNullChromosome,
RbtBadArgument);
CPPUNIT_TEST_EXCEPTION(testPopulationConstructorNullSF, RbtBadArgument);
CPPUNIT_TEST(testPopulationRWFitness);
CPPUNIT_TEST(testPopulationRWSelect);
CPPUNIT_TEST(testPopulationGAstep);
CPPUNIT_TEST(testRbtModelGetChromUndefinedFlexData);
CPPUNIT_TEST(testRbtModelGetChromNullFlexData);
CPPUNIT_TEST(testRbtModelGetChrom);
CPPUNIT_TEST(testRandomiseTetheredOrientation);
CPPUNIT_TEST(testRandomiseTetheredCOM);
CPPUNIT_TEST(testMutateTetheredOrientation);
CPPUNIT_TEST(testMutateTetheredCOM);
CPPUNIT_TEST(testCrossoverTetheredOrientation);
CPPUNIT_TEST(testCrossoverTetheredCOM);
CPPUNIT_TEST(testRandomiseTetheredDihedral);
CPPUNIT_TEST(testMutateTetheredDihedral);
CPPUNIT_TEST(testCrossoverTetheredDihedral);
CPPUNIT_TEST(testRandomiseOccupancy);
CPPUNIT_TEST(testOccupancyThreshold);
CPPUNIT_TEST_SUITE_END();
public:
class RbtChromTest : public ::testing::Test {
protected:
static double TINY;
// TextFixture methods
void setUp();
void tearDown();
void SetUp() override;
void TearDown() override;
// extra setup for building a simple scoring function and workspace
void setupWorkSpace();
......@@ -91,121 +45,6 @@ public:
void measureCrossoverDiff(RbtChromElement *chrom, int nTrials,
double &meanDiff, double &minDiff, double &maxDiff);
// The unit tests
// 1) Does RbtChromFactory create a valid chromosome?
void testChromFactory();
// 2) Can we delete a cloned chromosome without affecting the original?
void testCloneDestructor();
// 3) Is the length of a cloned chromosome equal to the original?
void testCloneLengthEquals();
// 4) Does operator== return true for a clone and an original (before
// mutation)?
void testChromOperatorEquals();
// 5) Does operator!= return true for a mutated clone and an original?
void testChromOperatorEqualsAfterMutate();
// 6) Does SyncToModel leave the model coords unchanged if chromosome has
// not been mutated?
void testSyncToModel();
// 7) Does SyncToModel change the model coords after a mutation?
void testSyncToModelAfterMutate();
// 8) Does SyncToModel leave the model coords unchanged if chromosome has
// been mutated then reset?
void testSyncToModelAfterReset();
// 9) If we make a clone BEFORE the original has been mutated, check that
// Reset() on the clone will reset to the original (unmutated) model coords
void testCloneReset();
// 10) If we make a clone AFTER the original has been mutated, check that
// Reset() on the clone still resets to the original (unmutated) model coords
void testMutatedCloneReset();
// 11) Does operator!= return true for a randomised clone and an original?
void testChromOperatorEqualsAfterRandomise();
// 12) Does SyncToModel change the model coords after a randomisation?
void testSyncToModelAfterRandomise();
// 13) Does SyncToModel leave the model coords unchanged if chromosome has
// been randomised then reset?
void testSyncToModelAfterRandomiseReset();
// 14) Does operator== return true for a mutated, reset clone and an original?
void testChromOperatorEqualsAfterMutateReset();
// 15) Does operator== return true for a randomised, reset clone and an
// original?
void testChromOperatorEqualsAfterRandomiseReset();
// 16) Check that chromosomes are still equal after crossover of unmutated
// clones
void testNullCrossover();
// 17) Check that conversion from quaternion to Euler angles and back
// is a null operation
void testEuler();
// 18) Check that repeated sync to/from model leaves the genotype and
// phenotype unchanged
void testRepeatedSync();
// 19) Check that an invalid Compare() returns -1 (i.e. for unequal chromosome
// lengths)
void testCompareWithNullChrom();
// 20) Check that Compare() after a single mutation never returns greater than
// the relative mutation distance (loops over 10000 repeats)
void testCompareAfterMutate();
// 21) Test operator== with modified _THRESHOLD
void testOperatorEqualsWithModifiedThreshold();
// 22) Test population constructor
void testPopulationConstructor();
// 23) Check that population constructor with zero size throws an error
void testPopulationConstructorZeroSize();
// 24) Check that population constructor with null chromosome throws an error
void testPopulationConstructorNullChromosome();
// 25) Check that population constructor with null scoring function throws an
// error
void testPopulationConstructorNullSF();
// 26) Check that roulette wheel fitness values are calculated OK
void testPopulationRWFitness();
// 27) Check that roulette wheel selection will select higher scoring genomes
// on average
void testPopulationRWSelect();
// 28) Check that population GAstep does not decrease the score of the best
// genome and that population size remains constant
void testPopulationGAstep();
// 29) Checks the behaviour of RbtModel::GetChrom if flex data has not been
// defined Should return a zero length chromosome for rigid model
void testRbtModelGetChromUndefinedFlexData();
// 30) Checks the behaviour of RbtModel::SetFlexData(NULL)
// Should return a zero length chromosome for rigid model
void testRbtModelGetChromNullFlexData();
// 31) Checks that RbtModel::SetFlexData creates the same chromosome
// as the manual method
void testRbtModelGetChrom();
// 32) Checks that the variation in randomised values remains in bounds
// for tethered orientations
void testRandomiseTetheredOrientation();
// 33) Checks that the variation in randomised values remains in bounds
// for tethered COM
void testRandomiseTetheredCOM();
// 34) Checks that the variation in mutated values remains in bounds
// for tethered orientations
void testMutateTetheredOrientation();
// 35) Checks that the variation in mutated values remains in bounds
// for tethered COM
void testMutateTetheredCOM();
// 36) Checks that the variation in crossed over values remains in bounds
// for tethered orientations
void testCrossoverTetheredOrientation();
// 37) Checks that the variation in crossed over values remains in bounds
// for tethered COM
void testCrossoverTetheredCOM();
// 38) Checks that the variation in randomised values remains in bounds
// for tethered dihedral
void testRandomiseTetheredDihedral();
// 39) Checks that the variation in mutated values remains in bounds
// for tethered dihedral
void testMutateTetheredDihedral();
// 40) Checks that the variation in crossed over values remains in bounds
// for tethered dihedral
void testCrossoverTetheredDihedral();
// 41) Checks that randomised occupancy is from a rectangular distribution
void testRandomiseOccupancy();
// 42) Checks that actual occupancy probability matches the desired
// probability
void testOccupancyThreshold();
private:
RbtModelPtr m_recep_1koc;
RbtModelPtr m_lig_1koc;
RbtDockingSitePtr m_site_1koc;
......@@ -214,4 +53,5 @@ private:
RbtBiMolWorkSpacePtr m_workSpace; // simple workspace
RbtSFAggPtr m_SF; // simple scoring function
};
#endif /*RBTCHROMTEST_H_*/
......@@ -12,9 +12,7 @@
#include "RbtVdwIdxSF.h"
#include "RbtVdwIntraSF.h"
CPPUNIT_TEST_SUITE_REGISTRATION(SearchTest);
void SearchTest::setUp() {
void SearchTest::SetUp() {
try {
// Create the docking site, receptor, ligand and solvent objects
const std::string &wsName = "1YET";
......@@ -55,7 +53,7 @@ void SearchTest::setUp() {
}
}
void SearchTest::tearDown() {
void SearchTest::TearDown() {
m_atomList.clear();
m_SF.SetNull();
m_workSpace.SetNull();
......@@ -76,21 +74,24 @@ double SearchTest::rmsd(const RbtCoordList &rc, const RbtCoordList &c) {
return retVal;
}
void SearchTest::testPRMFactory() {
CPPUNIT_ASSERT(m_workSpace->GetNumModels() == 6);
}
// 1 Check that receptor, ligand and solvent models are loaded into workspace
// Should be 6 models in total (4 solvent)
TEST_F(SearchTest, PRMFactory) { ASSERT_EQ(m_workSpace->GetNumModels(), 6); }
void SearchTest::testHeavyAtomFactory() {
// 2 Check RbtFlexDataVisitor subclass correctly identifies movable heavy atoms
// in cavity
TEST_F(SearchTest, HeavyAtomFactory) {
RbtAtomRList heavyAtomList;
// find all the movable heavy atoms in the receptor, ligand and solvent
if (m_workSpace) {
RbtCavityGridSF::HeavyAtomFactory atomFactory(m_workSpace->GetModels());
heavyAtomList = atomFactory.GetAtomList();
}
CPPUNIT_ASSERT(heavyAtomList.size() == 42);
ASSERT_EQ(heavyAtomList.size(), 42);
}
void SearchTest::testGA() {
// 3 Run a sample GA
TEST_F(SearchTest, GA) {
RbtTransformAggPtr spTransformAgg(new RbtTransformAgg());
RbtBaseTransform *pRandPop = new RbtRandPopTransform();
RbtBaseTransform *pGA = new RbtGATransform();
......@@ -106,10 +107,11 @@ void SearchTest::testGA() {
std::cout << e.Message() << std::endl;
isOK = false;
}
CPPUNIT_ASSERT(isOK);
ASSERT_TRUE(isOK);
}
void SearchTest::testSimplex() {
// 4 Run a sample Simplex
TEST_F(SearchTest, Simplex) {
RbtTransformAggPtr spTransformAgg(new RbtTransformAgg());
// RbtBaseTransform* pRandPop = new RbtRandPopTransform();
RbtBaseTransform *pSimplex = new RbtSimplexTransform();
......@@ -128,10 +130,11 @@ void SearchTest::testSimplex() {
std::cout << e.Message() << std::endl;
isOK = false;
}
CPPUNIT_ASSERT(isOK);
ASSERT_TRUE(isOK);
}
void SearchTest::testSimAnn() {
// 5 Run a sample simulated annealing
TEST_F(SearchTest, SimAnn) {
RbtBaseTransform *pSimAnn = new RbtSimAnnTransform();
pSimAnn->SetParameter(RbtBaseObject::_TRACE, 2);
pSimAnn->SetParameter(RbtSimAnnTransform::_BLOCK_LENGTH, 100);
......@@ -150,10 +153,11 @@ void SearchTest::testSimAnn() {
isOK = false;
}
delete pSimAnn;
CPPUNIT_ASSERT(isOK);
ASSERT_TRUE(isOK);
}
void SearchTest::testRestart() {
// 6 Check we can reload solvent coords from ligand SD file
TEST_F(SearchTest, Restart) {
RbtTransformAggPtr spTransformAgg(new RbtTransformAgg());
RbtBaseTransform *pSimplex = new RbtSimplexTransform();
pSimplex->SetParameter(RbtBaseObject::_TRACE, 1);
......@@ -200,5 +204,6 @@ void SearchTest::testRestart() {
std::cout << e.Message() << std::endl;
isOK = false;
}
CPPUNIT_ASSERT(isOK && (fabs(restartScore - finalScore) < 0.01));
ASSERT_TRUE(isOK);
ASSERT_LT(fabs(restartScore - finalScore), 0.01);
}
......@@ -13,7 +13,7 @@
#ifndef SEARCHTEST_H_
#define SEARCHTEST_H_
#include <cppunit/extensions/HelperMacros.h>
#include <gtest/gtest.h>
#include "RbtBiMolWorkSpace.h"
#include "RbtChrom.h"
......@@ -21,44 +21,19 @@
#include "RbtModel.h"
#include "RbtSFAgg.h"
class SearchTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(SearchTest);
CPPUNIT_TEST(testPRMFactory);
CPPUNIT_TEST(testHeavyAtomFactory);
CPPUNIT_TEST(testGA);
CPPUNIT_TEST(testSimplex);
CPPUNIT_TEST(testSimAnn);
CPPUNIT_TEST(testRestart);
CPPUNIT_TEST_SUITE_END();
public:
class SearchTest : public ::testing::Test {
protected:
// TextFixture methods
void setUp();
void tearDown();
void SetUp() override;
void TearDown() override;
// rdock helper methods
// RMSD calculation between two coordinate lists
double rmsd(const RbtCoordList &rc, const RbtCoordList &c);
// 1 Check that receptor, ligand and solvent models are loaded into workspace
// Should be 6 models in total (4 solvent)
void testPRMFactory();
// 2 Check RbtFlexDataVisitor subclass correctly identifies movable heavy
// atoms in cavity
void testHeavyAtomFactory();
// 3 Run a sample GA
void testGA();
// 4 Run a sample Simplex
void testSimplex();
// 5 Run a sample simulated annealing
void testSimAnn();
// 6 Check we can reload solvent coords from ligand SD file
void testRestart();
private:
RbtAtomList m_atomList; // All atoms in receptor, ligand and solvent
RbtBiMolWorkSpacePtr m_workSpace; // simple workspace
RbtSFAggPtr m_SF; // simple scoring function
};
#endif /*SEARCHTEST_H_*/
......@@ -130,19 +130,19 @@ endif
tests_opt = get_option('tests')
if tests_opt
cppunit_dep = dependency('cppunit', required : false)
if cppunit_dep.found()
gtest_dep = dependency('gtest', required : false)
if gtest_dep.found()
incTest = include_directories('build/test')
srcTest = [
'build/test/Main.cxx', 'build/test/OccupancyTest.cxx',
'build/test/RbtChromTest.cxx', 'build/test/SearchTest.cxx'
]
unit_test = executable(
'unit_test', srcTest, dependencies : cppunit_dep, link_with : libRbt,
'unit-test', srcTest, dependencies : gtest_dep, link_with : libRbt,
include_directories : [incTest, incRbt]
)
test(
'unit_test', unit_test,
'unit-test', unit_test,
env : ['RBT_ROOT=' + meson.current_source_dir(),
'RBT_HOME=' + meson.current_source_dir() + '/build/test/RBT_HOME'],
timeout : 900
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment