forked from boost-ext/ut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (44 loc) · 1.37 KB
/
CMakeLists.txt
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
#
# Copyright (c) 2019 Kris Jusiak (kris at jusiak dot net)
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
find_program(MEMORYCHECK_COMMAND valgrind)
if (ENABLE_MEMCHECK AND MEMORYCHECK_COMMAND)
function(example file target)
add_executable(${target} ${file}.cpp)
add_custom_command(TARGET ${target} COMMAND ${MEMORYCHECK_COMMAND}
--leak-check=full --error-exitcode=1 ./${target} ${ARGN})
endfunction()
else()
function(example file target)
add_executable(${target} ${file}.cpp)
add_custom_command(TARGET ${target} COMMAND ${target} ${ARGN})
endfunction()
endif()
example(cfg/runner runner)
example(cfg/reporter reporter)
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
example(abort abort)
endif()
example(BDD BDD)
example(cli cli_pass "cli.pass")
example(cli cli_pass_dry_run "cli.pass" "1")
example(cli cli_pass_not_dry_run "cli.pass" "0")
example(cli cli_all_dry_run "\\*" "1")
example(cli cli_fail_dry_run "cli.fail" "1")
example(exception exception)
example(expect expect)
example(filter filter)
example(hello_world hello_world)
example(log log)
example(macro macro)
example(minimal minimal)
example(matcher matcher)
example(parameterized parameterized)
example(run run)
example(section section)
example(skip skip)
example(suite suite)
example(using using)