forked from trilinos/Trilinos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctest_build.cmake
executable file
·104 lines (87 loc) · 3.52 KB
/
ctest_build.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
set(CTEST_ROOT_DIRECTORY "$ENV{HOME}/Dashboards/MyTests")
#set(CTEST_ROOT_DIRECTORY "$ENV{HOME}/Projects/Trilinos")
set(CTEST_SOURCE_DIRECTORY "${CTEST_ROOT_DIRECTORY}/Trilinos")
set(CTEST_BINARY_DIRECTORY "${CTEST_ROOT_DIRECTORY}/Trilinos-build")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_SITE "corrin.kitware")
set(CTEST_BUILD_NAME "Windows-make")
set(CTEST_BUILD_FLAGS -j2)
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(Trilinos_PACKAGES
${CTEST_PROJECT_SUBPROJECTS}
)
set(Trilinos_FAILED_PACKAGES) # store set of failed packages
ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}")
ctest_start("Experimental")
set(CTEST_DROP_SITE "arrakis.kitwarein.com")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Trilinos")
set(CTEST_DROP_SITE_CDASH TRUE)
# loop over all Trilinos packages
message("begin loop")
ctest_submit(FILES
${CTEST_SOURCE_DIRECTORY}/cmake/python/data/CDashSubprojectDependencies.xml)
foreach(TRIBITS_PACKAGE ${Trilinos_PACKAGES})
set_property(GLOBAL PROPERTY SubProject ${TRIBITS_PACKAGE})
set_property(GLOBAL PROPERTY Label ${TRIBITS_PACKAGE})
message("TRIBITS_PACKAGE='${TRIBITS_PACKAGE}'")
# CONFIGURE STEP
# create CONFIGURE_OPTIONS for this TRIBITS_PACKAGE
set(CONFIGURE_OPTIONS
"-DTrilinos_ENABLE_${TRIBITS_PACKAGE}:BOOL=ON"
"-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON"
"-DTrilinos_ENABLE_TESTS:BOOL=ON")
foreach(FAILED_PACKAGE ${Trilinos_FAILED_PACKAGES})
list(APPEND CONFIGURE_OPTIONS
"-DTrilinos_ENABLE_${FAILED_PACKAGE}:BOOL=OFF")
endforeach(FAILED_PACKAGE)
# new option for ctest_configure OPTIONS a list of command
# line arguments to give to cmake: -D stuff for example
ctest_configure(
BUILD "${CTEST_BINARY_DIRECTORY}"
OPTIONS "${CONFIGURE_OPTIONS}"
RETURN_VALUE res
)
# if the configure failed add the package to the list
# of failed packages
if(NOT "${res}" EQUAL "0")
list(APPEND FAILED_PACKAGE ${TRIBITS_PACKAGE})
else()
# load target properties and test keywords
ctest_read_custom_files(BUILD "${CTEST_BINARY_DIRECTORY}")
endif()
set(CTEST_DROP_SITE "arrakis.kitwarein.com")
# submit configure results
ctest_submit( ) # submit notes and configure at this point
# If configure passed, build and test
if("${res}" EQUAL "0")
# set the target to build, build it, and submit it
set(CTEST_BUILD_TARGET ${TRIBITS_PACKAGE}_libs)
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}"
RETURN_VALUE res APPEND)
ctest_submit( PARTS build ) # submit the build
# if the build failed add it to the failed packages
if(NOT "${res}" EQUAL "0")
list(APPEND FAILED_PACKAGE ${TRIBITS_PACKAGE})
else()
# inside here the build worked
# Now build ALL target, but append the results to the last build.xml
set(CTEST_BUILD_TARGET)
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}"
RETURN_VALUE res APPEND )
# submit the build for all target
# submit should take a list of things to submit
ctest_submit( PARTS build )
# now run the tests that match the ${TRIBITS_PACKAGE} name
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}"
INCLUDE ${TRIBITS_PACKAGE}
)
#ctest_memcheck(BUILD "${CTEST_BINARY_DIRECTORY}"
# KEYWORDS ${TRIBITS_PACKAGE})
#ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}")
# submit test, memcheck and coverage results
ctest_submit(PARTS Test)
endif()
endif()
endforeach(TRIBITS_PACKAGE)
message("end loop")