File tree Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 11add_library (safe_arithmetic INTERFACE )
2- target_include_directories (safe_arithmetic INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} )
2+ target_include_directories (safe_arithmetic
3+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} )
34target_link_libraries (safe_arithmetic INTERFACE boost_mp11)
Original file line number Diff line number Diff line change 1- ## Test that code is NOT able to compile
1+ # Test that code is NOT able to compile
22function (test_static_assert_fail TEST_NAME)
33 add_executable (${TEST_NAME} _t EXCLUDE_FROM_ALL ${TEST_NAME} .cpp)
44 target_link_libraries (${TEST_NAME} _t PRIVATE safe_arithmetic)
55 add_test (NAME ${TEST_NAME}
6- COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${TEST_NAME} _t
7- )
8- set_tests_properties (${TEST_NAME} PROPERTIES PASS_REGULAR_EXPRESSION "(static_assert)|(static assertion failed)" )
6+ COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target
7+ ${TEST_NAME} _t)
8+ set_tests_properties (
9+ ${TEST_NAME} PROPERTIES PASS_REGULAR_EXPRESSION
10+ "(static_assert)|(static assertion failed)" )
911endfunction ()
1012
11- ## Test that code that must compile
13+ # Test that code that must compile
1214function (test_static_assert_pass TEST_NAME)
1315 add_executable (${TEST_NAME} _t EXCLUDE_FROM_ALL ${TEST_NAME} .cpp)
1416 target_link_libraries (${TEST_NAME} _t PRIVATE safe_arithmetic)
1517 add_test (NAME ${TEST_NAME}
16- COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${TEST_NAME} _t
17- )
18+ COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target
19+ ${TEST_NAME} _t )
1820endfunction ()
1921
20- add_subdirectory (safe)
22+ add_subdirectory (safe)
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ test_static_assert_fail(construct_constant_min_violation)
55test_static_assert_fail(interval_larger_than_type)
66test_static_assert_fail(assign_lhs_rhs_union)
77test_static_assert_fail(assign_lhs_union)
8- test_static_assert_fail(assign_rhs_union)
8+ test_static_assert_fail(assign_rhs_union)
You can’t perform that action at this time.
0 commit comments