3
3
# See LICENSE.TXT
4
4
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5
5
6
- set (UR_VALIDATION_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
7
- set (VAL_TEST_PREFIX validation_test )
6
+ set (UR_SANITIZER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
7
+ set (SAN_TEST_PREFIX sanitizer_test )
8
8
9
- function (add_validation_test_executable name )
10
- add_ur_executable (${VAL_TEST_PREFIX } -${name}
9
+ function (add_sanitizer_test_executable name )
10
+ add_ur_executable (${SAN_TEST_PREFIX } -${name}
11
11
${ARGN} )
12
- target_link_libraries (${VAL_TEST_PREFIX } -${name}
12
+ target_link_libraries (${SAN_TEST_PREFIX } -${name}
13
13
PRIVATE
14
14
${PROJECT_NAME} ::loader
15
15
${PROJECT_NAME} ::headers
@@ -18,39 +18,34 @@ function(add_validation_test_executable name)
18
18
GTest::gtest_main )
19
19
endfunction ()
20
20
21
- function (set_validation_test_properties name )
22
- set_tests_properties (${name} PROPERTIES LABELS "validation " )
21
+ function (set_sanitizer_test_properties name )
22
+ set_tests_properties (${name} PROPERTIES LABELS "sanitizer " )
23
23
set_property (TEST ${name} PROPERTY ENVIRONMENT
24
- "UR_ENABLE_LAYERS=UR_LAYER_FULL_VALIDATION"
25
- "UR_ADAPTERS_FORCE_LOAD=\" $<TARGET_FILE:ur_adapter_mock>\" "
26
- "UR_LOG_VALIDATION=level:debug\; flush:debug\; output:stdout" )
24
+ "UR_LOG_SANITIZER=level:debug\; flush:debug\; output:stdout" )
27
25
endfunction ()
28
26
29
- function (add_validation_test name )
30
- add_validation_test_executable (${name} ${ARGN} )
27
+ function (add_sanitizer_test name )
28
+ add_sanitizer_test_executable (${name} ${ARGN} )
31
29
32
30
add_test (NAME ${name}
33
- COMMAND ${VAL_TEST_PREFIX } -${name}
31
+ COMMAND ${SAN_TEST_PREFIX } -${name}
34
32
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
35
33
36
- set_validation_test_properties (${name} )
34
+ set_sanitizer_test_properties (${name} )
37
35
endfunction ()
38
36
39
- function (add_validation_match_test name )
40
- add_validation_test_executable (${name} ${ARGN} )
37
+ function (add_sanitizer_match_test name )
38
+ add_sanitizer_test_executable (${name} ${ARGN} )
41
39
42
40
add_test (NAME ${name}
43
41
COMMAND ${CMAKE_COMMAND}
44
42
-D MODE=stdout
45
- -D TEST_FILE=$<TARGET_FILE:${VAL_TEST_PREFIX }-${name}>
43
+ -D TEST_FILE=$<TARGET_FILE:${SAN_TEST_PREFIX }-${name}>
46
44
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${name}.out.match
47
45
-P ${PROJECT_SOURCE_DIR} /cmake/match.cmake
48
46
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
49
47
50
- set_validation_test_properties (${name} )
48
+ set_sanitizer_test_properties (${name} )
51
49
endfunction ()
52
50
53
- add_validation_test (parameters parameters.cpp )
54
- add_validation_match_test (leaks leaks.out.match leaks.cpp )
55
- add_validation_match_test (leaks_mt leaks_mt.out.match leaks_mt.cpp )
56
- add_validation_match_test (lifetime lifetime.out.match lifetime.cpp )
51
+ add_sanitizer_test (asan asan.cpp )
0 commit comments