@@ -6,52 +6,17 @@ include_directories(
66 ${pfasst_INCLUDES}
77)
88
9- set (TESTS
10- test_advection_diffusion
11- )
12-
139if (${pfasst_WITH_MPI} )
1410 set (MPI_TESTS
1511 test_mpi_advection_diffusion
1612 )
17- endif ()
18-
19- foreach (test ${TESTS} )
20- message (STATUS " ${test} " )
21- add_executable (${test} ${test} .cpp)
22- if (NOT FFTW_FOUND)
23- add_dependencies (${test} fftw3)
24- endif ()
25- if (${pfasst_NUM_DEPENDEND_TARGETS} GREATER 0)
26- add_dependencies (${test} ${pfasst_DEPENDEND_TARGETS} )
27- endif ()
28- if (${pfasst_TESTS_NUM_DEPENDEND_TARGETS} GREATER 0)
29- add_dependencies (${test} ${pfasst_TESTS_DEPENDEND_TARGETS} )
30- endif ()
31- target_link_libraries (${test}
32- ${3rdparty_DEPENDEND_LIBS}
33- ${TESTS_3rdparty_DEPENDEND_LIBS}
34- ${FFTW_LIBRARIES}
35- ${pfasst_DEPENDEND_LIBS}
36- )
37- if (pfasst_WITH_GCC_PROF AND ${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
38- set_target_properties (${test}
39- PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs"
40- LINK_FLAGS "-fprofile-arcs"
41- )
42- endif ()
43- add_test (NAME ${test}
44- COMMAND ${CMAKE_BINARY_DIR} /tests/examples/advection_diffusion/${test} --gtest_output=xml:${test} _out.xml
45- )
46- endforeach (test )
4713
48- if (${pfasst_WITH_MPI} )
4914 include_directories (${MPI_CXX_INCLUDE_PATH} )
5015 foreach (test ${MPI_TESTS} )
5116 message (STATUS " ${test} " )
5217 add_executable (${test} ${test} .cpp)
5318 if (NOT FFTW_FOUND)
54- add_dependencies (${test} fftw3)
19+ add_dependencies (${test} fftw3)
5520 endif ()
5621 if (${pfasst_NUM_DEPENDEND_TARGETS} GREATER 0)
5722 add_dependencies (${test} ${pfasst_DEPENDEND_TARGETS} )
@@ -83,4 +48,37 @@ if(${pfasst_WITH_MPI})
8348 COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 ${MPIEXEC_PREFLAGS} ${CMAKE_BINARY_DIR} /tests/examples/advection_diffusion/${test} ${MPIEXEC_POSTFLAGS}
8449 )
8550 endforeach (test )
51+ else ()
52+ set (TESTS
53+ test_advection_diffusion
54+ )
55+
56+ foreach (test ${TESTS} )
57+ message (STATUS " ${test} " )
58+ add_executable (${test} ${test} .cpp)
59+ if (NOT FFTW_FOUND)
60+ add_dependencies (${test} fftw3)
61+ endif ()
62+ if (${pfasst_NUM_DEPENDEND_TARGETS} GREATER 0)
63+ add_dependencies (${test} ${pfasst_DEPENDEND_TARGETS} )
64+ endif ()
65+ if (${pfasst_TESTS_NUM_DEPENDEND_TARGETS} GREATER 0)
66+ add_dependencies (${test} ${pfasst_TESTS_DEPENDEND_TARGETS} )
67+ endif ()
68+ target_link_libraries (${test}
69+ ${3rdparty_DEPENDEND_LIBS}
70+ ${TESTS_3rdparty_DEPENDEND_LIBS}
71+ ${FFTW_LIBRARIES}
72+ ${pfasst_DEPENDEND_LIBS}
73+ )
74+ if (pfasst_WITH_GCC_PROF AND ${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
75+ set_target_properties (${test}
76+ PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs"
77+ LINK_FLAGS "-fprofile-arcs"
78+ )
79+ endif ()
80+ add_test (NAME ${test}
81+ COMMAND ${CMAKE_BINARY_DIR} /tests/examples/advection_diffusion/${test} --gtest_output=xml:${test} _out.xml
82+ )
83+ endforeach (test )
8684endif ()
0 commit comments