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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
#
# Copyright (c) 2019-2020 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(BOOST_UT_MEMORYCHECK_COMMAND valgrind)
function(example file target)
add_executable(boost_ut_${target} ${file}.cpp)
if(BOOST_UT_ENABLE_MEMCHECK AND BOOST_UT_MEMORYCHECK_COMMAND)
ut_add_custom_command_or_test(
TARGET
boost_ut_${target}
COMMAND
${BOOST_UT_MEMORYCHECK_COMMAND}
--leak-check=full
--error-exitcode=1
./boost_ut_${target}
${ARGN}
)
else()
ut_add_custom_command_or_test(TARGET boost_ut_${target} COMMAND boost_ut_${target} ${ARGN})
endif()
endfunction()
example(cfg/printer printer)
example(cfg/runner runner)
if(APPLE OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
example(cfg/parallel_runner parallel_runner)
endif()
# if(DEFINED ENV{TBB_ROOT})
# set(TBB_ROOT $ENV{TBB_ROOT})
# # FIXME: include could not find load file:
# include(${TBB_ROOT}/cmake/TBBBuild.cmake)
# tbb_build(TBB_ROOT ${TBB_ROOT} CONFIG_DIR TBB_DIR MAKE_ARGS stdver="c++17")
# find_package(TBB)
# target_link_libraries(boost_ut_parallel_runner ${TBB_IMPORTED_TARGETS})
# endif()
example(cfg/reporter reporter)
if(NOT WIN32)
example(abort abort)
endif()
example(attr attr)
example(BDD BDD)
example(benchmark benchmark)
example(cli cli_pass "cli.pass")
example(cli cli_pass_no_colors "cli.pass" "0" "1")
example(cli cli_pass_dry_run "cli.pass" "1" "1")
example(cli cli_pass_not_dry_run "cli.pass" "1" "0")
example(cli cli_all_dry_run "\\*" "1" "1")
example(cli cli_fail_dry_run "cli.fail" "1" "1")
example(exception exception)
example(expect expect)
example(fatal fatal)
example(filter filter)
if(NOT WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
example(gherkin gherkin)
example(gherkin gherkin_feature "../../example/gherkin.feature")
endif()
example(hello_world hello_world)
example(log log)
example(macro macro)
example(main main '')
example(minimal minimal)
example(mut mut)
example(matcher matcher)
if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
example(parameterized parameterized)
endif()
example(run run)
example(run_report run_report)
example(section section)
example(should should)
example(skip skip)
example(sl sl)
example(spec spec)
example(suite suite)
example(tag tag)
example(terse terse)
example(test _test)
example(tmp tmp)
example(using using)
|