Skip to content

Commit 4ab5b26

Browse files
committed
Added simple support to CTest
- Enable testing support - Add TEST targets - Copy input files to build directory
1 parent fa0099d commit 4ab5b26

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ SET(CMAKE_VERBOSE_MAKEFILE FALSE)
44

55
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
66

7+
#======================#
8+
# Enable testing
9+
#======================#
10+
11+
ENABLE_TESTING()
12+
INCLUDE(CTest)
13+
714
#======================#
815
# Build paths
916
#======================#

CTestConfig.cmake

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## This file should be placed in the root directory of your project.
2+
## Then modify the CMakeLists.txt file in the root directory of your
3+
## project to incorporate the testing dashboard.
4+
##
5+
## # The following are required to submit to the CDash dashboard:
6+
## ENABLE_TESTING()
7+
## INCLUDE(CTest)
8+
9+
set(CTEST_PROJECT_NAME "FoX")
10+
set(CTEST_NIGHTLY_START_TIME "0")
11+
12+
set(CTEST_DROP_METHOD "http")
13+
set(CTEST_DROP_SITE "cdash.example.com")
14+
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Generic")
15+
set(CTEST_DROP_SITE_CDASH TRUE)

examples/CMakeLists.txt

+11
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,59 @@ add_executable(
44
target_link_libraries(
55
wxml_example
66
${PROJECT_NAME}_wxml)
7+
ADD_TEST(wxml_example_TEST ${EXECUTABLE_OUTPUT_PATH}/wxml_example)
8+
79

810
add_executable(
911
wcml_example
1012
wcml_example.f90)
1113
target_link_libraries(
1214
wcml_example
1315
${PROJECT_NAME}_wcml)
16+
ADD_TEST(wcml_example_TEST ${EXECUTABLE_OUTPUT_PATH}/wcml_example)
1417

1518
add_executable(
1619
wkml_example
1720
wkml_example.f90)
1821
target_link_libraries(
1922
wkml_example
2023
${PROJECT_NAME}_wkml)
24+
ADD_TEST(wkml_example_TEST ${EXECUTABLE_OUTPUT_PATH}/wkml_example)
2125

2226
add_executable(
2327
sax_example
2428
sax_example.f90)
2529
target_link_libraries(
2630
sax_example
2731
${PROJECT_NAME}_sax)
32+
ADD_CUSTOM_COMMAND(TARGET sax_example PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/staffNS.xml ${PROJECT_BINARY_DIR}/examples)
33+
ADD_TEST(sax_example_TEST ${EXECUTABLE_OUTPUT_PATH}/sax_example)
2834

2935
add_executable(
3036
sax_example_2
3137
sax_example_2.f90)
3238
target_link_libraries(
3339
sax_example_2
3440
${PROJECT_NAME}_sax)
41+
ADD_TEST(sax_example_2_TEST ${EXECUTABLE_OUTPUT_PATH}/sax_example_2)
3542

3643
add_executable(
3744
dom_example_2
3845
dom_example_2.f90)
3946
target_link_libraries(
4047
dom_example_2
4148
${PROJECT_NAME}_dom)
49+
ADD_CUSTOM_COMMAND(TARGET dom_example_2 PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/h2o.xml ${PROJECT_BINARY_DIR}/examples)
50+
ADD_TEST(dom_example_2_TEST ${EXECUTABLE_OUTPUT_PATH}/dom_example_2)
4251

4352
add_executable(
4453
dom_example_3
4554
dom_example_3.f90)
4655
target_link_libraries(
4756
dom_example_3
4857
${PROJECT_NAME}_dom)
58+
ADD_CUSTOM_COMMAND(TARGET dom_example_3 PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/h2o.xml ${PROJECT_BINARY_DIR}/examples)
59+
ADD_TEST(dom_example_2_TEST ${EXECUTABLE_OUTPUT_PATH}/dom_example_2)
4960

5061

5162
include_directories(

0 commit comments

Comments
 (0)