blob: b9c6db4e426d8bf6ce5e75ca8f3db0d6698ffc69 (
plain)
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
|
project(tests C)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/include
)
set(CMOCKA_TESTS
test_fixtures
test_assert_macros
test_assert_macros_fail
test_exception_handler)
foreach(_CMOCKA_TEST ${CMOCKA_TESTS})
add_cmocka_test(${_CMOCKA_TEST} ${_CMOCKA_TEST}.c ${CMOCKA_SHARED_LIBRARY})
endforeach()
### Exceptions
# test_assert_macros_fail
set_tests_properties(
test_assert_macros_fail
PROPERTIES
PASS_REGULAR_EXPRESSION
"\\[ FAILED \\] 1 test"
)
# test_exception_handler
set_tests_properties(
test_exception_handler
PROPERTIES
PASS_REGULAR_EXPRESSION
"Test failed with exception: (Segmentation fault|Segmentation Fault|11)"
)
|