File: CheckTarget.cmake

package info (click to toggle)
evolution 3.56.2-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 135,044 kB
  • sloc: ansic: 519,950; javascript: 8,494; xml: 5,207; python: 702; makefile: 563; sh: 294; perl: 169
file content (22 lines) | stat: -rw-r--r-- 735 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# CheckTarget.cmake
#
# Defines a custom target 'check', which gathers test programs like 'make check'
# This is taken from https://cmake.org/Wiki/CMakeEmulateMakeCheck
#
# What you do is to call command:
# add_check_test(_name)
#   where _name is the name of the test, as defined by add_executable().
#   Note it is a good idea to use EXCLUDE_FROM_ALL within the add_executable().

include(CTest)

# Disable this to not have verbose tests
set(CMAKE_CTEST_COMMAND ${CMAKE_CTEST_COMMAND} -V)

add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})

macro(add_check_test _name)
	add_test(NAME ${_name} COMMAND ${_name})
	set_tests_properties(${_name} PROPERTIES RUN_SERIAL ON)
	add_dependencies(check ${_name})
endmacro(add_check_test)