Skip to content

Commit

Permalink
Merge pull request opencog#21 from Bitseat/restructure_moses_tests
Browse files Browse the repository at this point in the history
Restructure moses/tests
  • Loading branch information
ngeiswei authored Nov 2, 2018
2 parents 65c5ad8 + 6b7b959 commit e19f2a4
Show file tree
Hide file tree
Showing 42 changed files with 142 additions and 128 deletions.
124 changes: 5 additions & 119 deletions tests/moses/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,122 +1,8 @@
#
# Tests are listed and run in more-or-less dependency order:
# Later tests assume earlier tests pass.
#
ADD_SUBDIRECTORY (scoring)
ADD_SUBDIRECTORY (metapopulation)
ADD_SUBDIRECTORY (moses)
ADD_SUBDIRECTORY (optimization)
ADD_SUBDIRECTORY (representation)
ADD_SUBDIRECTORY (main)

ADD_CXXTEST(iostream_scored_combo_treeUTest)
TARGET_LINK_LIBRARIES(iostream_scored_combo_treeUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(KnobTurningUTest)
TARGET_LINK_LIBRARIES(KnobTurningUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

# requires boost::math; don't build if not found.
IF(Boost_MATH_C99_FOUND)
ADD_CXXTEST(NeighborSamplingUTest)
TARGET_LINK_LIBRARIES(NeighborSamplingUTest
moses
ascombo
${COGUTIL_LIBRARY}
)
ENDIF(Boost_MATH_C99_FOUND)


ADD_CXXTEST(FieldSetUTest)
TARGET_LINK_LIBRARIES(FieldSetUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(representationUTest)
TARGET_LINK_LIBRARIES(representationUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(scoringUTest)
TARGET_LINK_LIBRARIES(scoringUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(metapopulationUTest)
TARGET_LINK_LIBRARIES(metapopulationUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(optimizationUTest)
TARGET_LINK_LIBRARIES(optimizationUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(MOSESUTest)
TARGET_LINK_LIBRARIES(MOSESUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(weightedUTest)
TARGET_LINK_LIBRARIES(weightedUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(mixedUTest)
TARGET_LINK_LIBRARIES(mixedUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(irisUTest)
TARGET_LINK_LIBRARIES(irisUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(selectionUTest)
TARGET_LINK_LIBRARIES(selectionUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(dynFeatSelUTest)
TARGET_LINK_LIBRARIES(dynFeatSelUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(AntUTest)
TARGET_LINK_LIBRARIES(AntUTest
ant_scoring
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)
52 changes: 52 additions & 0 deletions tests/moses/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# Tests are listed and run in more-or-less dependency order:
# Later tests assume earlier tests pass.
#
ADD_CXXTEST(MOSESUTest)
TARGET_LINK_LIBRARIES(MOSESUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(mixedUTest)
TARGET_LINK_LIBRARIES(mixedUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(irisUTest)
TARGET_LINK_LIBRARIES(irisUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(selectionUTest)
TARGET_LINK_LIBRARIES(selectionUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(dynFeatSelUTest)
TARGET_LINK_LIBRARIES(dynFeatSelUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(weightedUTest)
TARGET_LINK_LIBRARIES(weightedUTest
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using namespace opencog::moses;

const string MOSESUTest_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/";
const string MOSESUTest_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/main/";

/**
* MOSES test on toy problems
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

#include <cxxtest/TestSuite.h>
#include <opencog/util/mt19937ar.h>
#include "moses-framework.h"
#include "tests/moses/main/moses-framework.h"

using namespace opencog::moses;

const string test_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/";
const string test_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/main/";

/**
* Test operation of the dynamic feature selector.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

using namespace opencog::moses;

const string mixedUTest_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/";
const string mixedUTest_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/main/";

/**
* Test learning of problems that require a mixture of boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

using namespace opencog::moses;

const string mixedUTest_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/";
const string mixedUTest_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/main/";

/**
* Test learning of problems that require a mixture of boolean
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

using namespace opencog::moses;

const string test_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/";
const string test_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/main/";

/**
* Test of the selection scorer
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
*/

#include <cxxtest/TestSuite.h>
#include "moses-framework.h"
#include "tests/moses/main/moses-framework.h"

using namespace opencog::moses;

const string weightedUTest_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/";
const string weightedUTest_dir = string(PROJECT_SOURCE_DIR) + "/tests/moses/main/";

/**
* Test learning of problems that require a weieghted score
Expand Down
6 changes: 6 additions & 0 deletions tests/moses/metapopulation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ADD_CXXTEST(metapopulationUTest)
TARGET_LINK_LIBRARIES(metapopulationUTest
moses
ascombo
${COGUTIL_LIBRARY}
)
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions tests/moses/moses/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# requires boost::math; don't build if not found.
IF(Boost_MATH_C99_FOUND)
ADD_CXXTEST(NeighborSamplingUTest)
TARGET_LINK_LIBRARIES(NeighborSamplingUTest
moses
ascombo
${COGUTIL_LIBRARY}
)
ENDIF(Boost_MATH_C99_FOUND)

ADD_CXXTEST(AntUTest)
TARGET_LINK_LIBRARIES(AntUTest
ant_scoring
asmoses_exec
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(iostream_scored_combo_treeUTest)
TARGET_LINK_LIBRARIES(iostream_scored_combo_treeUTest
moses
ascombo
${COGUTIL_LIBRARY}
)
File renamed without changes.
6 changes: 6 additions & 0 deletions tests/moses/optimization/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ADD_CXXTEST(optimizationUTest)
TARGET_LINK_LIBRARIES(optimizationUTest
moses
ascombo
${COGUTIL_LIBRARY}
)
File renamed without changes.
19 changes: 19 additions & 0 deletions tests/moses/representation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ADD_CXXTEST(representationUTest)
TARGET_LINK_LIBRARIES(representationUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(KnobTurningUTest)
TARGET_LINK_LIBRARIES(KnobTurningUTest
moses
ascombo
${COGUTIL_LIBRARY}
)
ADD_CXXTEST(FieldSetUTest)
TARGET_LINK_LIBRARIES(FieldSetUTest
moses
ascombo
${COGUTIL_LIBRARY}
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions tests/moses/scoring/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
ADD_CXXTEST(scoringUTest)
TARGET_LINK_LIBRARIES(scoringUTest
moses
ascombo
${COGUTIL_LIBRARY}
)

ADD_CXXTEST(atomese_LBS_UTest)
TARGET_LINK_LIBRARIES(atomese_LBS_UTest
moses
Expand Down
13 changes: 13 additions & 0 deletions tests/moses/scoring/precision.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# v2 is great at maximizing the precision of the target, while v1 is
# great at maximizing the negative predictive value of the target
target,v1,v2
0,0,0
0,1,0
0,0,0
0,1,0
0,1,0
1,0,0
1,0,0
1,0,1
1,0,1
1,0,1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace combo;
using namespace moses;
using namespace std;

const string mosesUTest_dir=string(PROJECT_SOURCE_DIR) + "/tests/moses/";
const string mosesUTest_dir=string(PROJECT_SOURCE_DIR) + "/tests/moses/main/";
const string target_feature = "target";

class scoringUTest : public CxxTest::TestSuite
Expand Down

0 comments on commit e19f2a4

Please sign in to comment.