-
Notifications
You must be signed in to change notification settings - Fork 12
/
test.cmake
36 lines (32 loc) · 824 Bytes
/
test.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
cmake_minimum_required(VERSION 3.10.0)
set(build_dir ${CMAKE_CURRENT_LIST_DIR}/gen)
cmake_host_system_information(RESULT core_size QUERY NUMBER_OF_LOGICAL_CORES)
if(NOT EXISTS ${build_dir})
file(MAKE_DIRECTORY ${build_dir})
execute_process(
COMMAND ${CMAKE_COMMAND}
-DBUILD_TEST=ON
${CMAKE_CURRENT_LIST_DIR}
WORKING_DIRECTORY ${build_dir}
RESULT_VARIABLE result
)
if(NOT result EQUAL 0)
return()
endif()
endif()
execute_process(
COMMAND make -j ${core_size} spec_runner
WORKING_DIRECTORY ${build_dir}
RESULT_VARIABLE result
)
if(NOT result EQUAL 0)
return()
endif()
execute_process(
COMMAND ctest -j ${core_size} --output-on-failure --no-label-summary -L ${CMAKE_ARGV3}
WORKING_DIRECTORY ${build_dir}
RESULT_VARIABLE result
)
if(NOT result EQUAL 0)
return()
endif()