Skip to content

Commit 5af38fe

Browse files
committed
fix false-positive build errors reported on cdash
1 parent 2067e48 commit 5af38fe

File tree

2 files changed

+21
-43
lines changed

2 files changed

+21
-43
lines changed

run_ctest.cmake

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -50,38 +50,6 @@ function( SUBMIT_TEST part )
5050
endif()
5151
endfunction( SUBMIT_TEST part )
5252

53-
# find number of processors, for faster builds
54-
# from http://www.kitware.com/blog/home/post/63
55-
if(NOT DEFINED PROCESSOR_COUNT)
56-
# Unknown:
57-
set(PROCESSOR_COUNT 0)
58-
59-
# Linux:
60-
set(cpuinfo_file "/proc/cpuinfo")
61-
if(EXISTS "${cpuinfo_file}")
62-
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
63-
list(LENGTH procs PROCESSOR_COUNT)
64-
endif()
65-
66-
# Mac:
67-
if(APPLE)
68-
find_program(cmd_sys_pro "system_profiler")
69-
if(cmd_sys_pro)
70-
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
71-
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
72-
PROCESSOR_COUNT "${info}")
73-
endif()
74-
endif()
75-
76-
# Windows:
77-
if(WIN32)
78-
set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
79-
endif()
80-
endif()
81-
82-
set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
83-
84-
8553
######################################################
8654
##### To disable reporting of a set of tests, comment
8755
##### out the SUBMIT_TEST line immediately following
@@ -94,29 +62,33 @@ set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
9462
ctest_start(Experimental)
9563
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
9664

65+
file(WRITE "${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake" "
66+
set( CTEST_CUSTOM_ERROR_EXCEPTION \"{standard input}:[0-9][0-9]*: WARNING: \")
67+
")
68+
9769
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DSCL_ENABLE_TESTING=ON )
9870
SUBMIT_TEST( Configure )
9971
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND )
10072
SUBMIT_TEST( Build )
101-
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL ${PROCESSOR_COUNT} )
73+
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res )
10274

10375
if(NOT SKIP_TEST_UNITARY_SCHEMAS )
10476
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
105-
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "unitary_schemas" )
77+
INCLUDE_LABEL "unitary_schemas" )
10678
SUBMIT_TEST( Test )
10779
endif()
10880

10981
if(NOT SKIP_CPP_TEST_SCHEMA_GEN )
11082
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
111-
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_gen" )
83+
INCLUDE_LABEL "cpp_schema_gen" )
11284
SUBMIT_TEST( Test )
11385
if(NOT SKIP_CPP_TEST_SCHEMA_BUILD )
11486
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
115-
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_build" )
87+
INCLUDE_LABEL "cpp_schema_build" )
11688
SUBMIT_TEST( Test )
11789
if(NOT SKIP_CPP_TEST_SCHEMA_RW )
11890
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
119-
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_rw" )
91+
INCLUDE_LABEL "cpp_schema_rw" )
12092
SUBMIT_TEST( Test )
12193
endif()
12294
endif()
@@ -125,17 +97,17 @@ endif()
12597
if(NOT SKIP_TEST_EXCHANGE_FILE )
12698
if( SKIP_CPP_TEST_SCHEMA_BUILD )
12799
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
128-
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE "build_cpp_sdai_AP214E3_2010" )
100+
INCLUDE "build_cpp_sdai_AP214E3_2010" )
129101
SUBMIT_TEST( Test )
130102
endif()
131103
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
132-
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "exchange_file" )
104+
INCLUDE_LABEL "exchange_file" )
133105
SUBMIT_TEST( Test )
134106
endif()
135107

136108
if(NOT SKIP_TEST_CPP_SCHEMA_SPECIFIC )
137109
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
138-
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_specific" )
110+
INCLUDE_LABEL "cpp_schema_specific" )
139111
SUBMIT_TEST( Test )
140112
endif()
141113

test/cpp/schema_specific/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ INCLUDE_DIRECTORIES( ${SCL_SOURCE_DIR}/src/cldai ${SCL_SOURCE_DIR}/src/cleditor
1010
# two optional args: ARGV3, ARGV4 are compile flags and libs, respectively.
1111
FUNCTION( add_schema_dependent_test name sdai_lib exe_args )
1212
add_executable( tst_${name} "${name}.cc" )
13-
set_target_properties( tst_${name} PROPERTIES COMPILE_FLAGS "-I${CMAKE_BINARY_DIR}/${sdai_lib} ${ARGV3}" )
13+
set_target_properties( tst_${name} PROPERTIES COMPILE_FLAGS "-I${CMAKE_BINARY_DIR}/${sdai_lib} ${ARGV3}" EXCLUDE_FROM_ALL ON )
1414
target_link_libraries( tst_${name} sdai_${sdai_lib} ${ARGV4} )
15+
add_test( NAME build_cpp_${name}
16+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
17+
COMMAND ${CMAKE_COMMAND} --build .
18+
--target tst_${name}
19+
--config $<CONFIGURATION> )
20+
set_tests_properties( build_cpp_${name} PROPERTIES DEPENDS build_cpp_sdai_${sdai_lib}
21+
LABELS cpp_schema_specific )
1522
add_test( NAME test_${name}
1623
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
1724
COMMAND $<TARGET_FILE:tst_${name}> ${exe_args} )
18-
set_tests_properties( test_${name} PROPERTIES DEPENDS build_cpp_sdai_${sdai_lib}
19-
DEPENDS tst_${name}
25+
set_tests_properties( test_${name} PROPERTIES DEPENDS build_cpp_${name}
2026
LABELS cpp_schema_specific )
2127
ENDFUNCTION( add_schema_dependent_test name sdai_lib exe_args )
2228

0 commit comments

Comments
 (0)