File: CheckTarget.cmake

package info (click to toggle)
evolution-data-server 3.56.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 46,656 kB
  • sloc: ansic: 365,352; xml: 578; cpp: 482; perl: 297; sh: 62; makefile: 60; python: 35; javascript: 29
file content (22 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (2)
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} ${ARGN})
	set_tests_properties(${_name} PROPERTIES RUN_SERIAL ON)
	add_dependencies(check ${_name})
endmacro(add_check_test)