CMakeLists.txt 1.37 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
set(MLMC_TEST_LIBRARIES ${MLMC_LIBRARIES} ${MPP_TEST_LIBRARIES})

# ------- Create Directories -------
file(COPY ${PROJECT_SOURCE_DIR}/mlmc/conf DESTINATION ${CMAKE_BINARY_DIR}/mlmc/)

file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/mlmc/tests/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/mlmc/tests/data/py)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/mlmc/tests/data/vtu)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/mlmc/tests/log)

# ------- Tests Macro -------
macro(add_mlmc_test testpath)
    # To remove pathnames infront of testname
    string(FIND ${testpath} "/" pos REVERSE)
    MATH(EXPR pos "${pos}+1")
    string(SUBSTRING ${testpath} ${pos} -1 testname)
    add_executable(${testname} ${testpath}.cpp)
    target_link_libraries(${testname} ${MLMC_TEST_LIBRARIES})
    add_test(${testname} ${testname})
endmacro()

# ------- Unit Tests -------
niklas.baumgarten's avatar
niklas.baumgarten committed
23
add_mlmc_test(basics/TestLevel)
24
add_mlmc_test(basics/TestPlotMap)
niklas.baumgarten's avatar
niklas.baumgarten committed
25

26
27
add_mlmc_test(generators/TestNormalDistribution)
add_mlmc_test(generators/TestCirculantEmbedding)
28

29
30
31
32
33
34
35
36
37
38
add_mlmc_test(montecarlo/TestMonteCarlo)
add_mlmc_test(pdesolver/TestPDESolver)
add_mlmc_test(montecarlo/datastructure/TestEmpiricMeasureLevelMaps)
add_mlmc_test(montecarlo/datastructure/TestExponents)
add_mlmc_test(montecarlo/datastructure/TestErrors)

# ------- Integration Tests -------
add_executable(TestMain TestMain.cpp)
target_link_libraries(TestMain ${MLMC_TEST_LIBRARIES})