Skip to content

Commit abdeba6

Browse files
committed
Add tracing layer logger test
1 parent b322118 commit abdeba6

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

test/layers/tracing/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ add_test(NAME example-collected-hello-world
4343

4444
set_tracing_test_props(example-collected-hello-world collector)
4545

46+
add_test(NAME example-logged-hello-world
47+
COMMAND ${CMAKE_COMMAND}
48+
-D MODE=stdout
49+
-D TEST_FILE=$<TARGET_FILE:hello_world>
50+
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/hello_world.out.logged.match
51+
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
52+
DEPENDS hello_world
53+
)
54+
set_tests_properties(example-logged-hello-world PROPERTIES LABELS "tracing")
55+
set_property(TEST example-logged-hello-world PROPERTY ENVIRONMENT
56+
"UR_LOG_TRACING=level:info\;output:stdout"
57+
"UR_ADAPTERS_FORCE_LOAD=\"$<TARGET_FILE:ur_adapter_null>\""
58+
"UR_ENABLE_LAYERS=UR_LAYER_TRACING")
59+
4660
function(add_tracing_test name)
4761
set(TEST_TARGET_NAME tracing-test-${name})
4862
add_ur_executable(${TEST_TARGET_NAME}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Platform initialized.
2+
---> urAdapterGet(.NumEntries = 0, .phAdapters = {{.*}}, .pNumAdapters = {{.*}} (1)) -> UR_RESULT_SUCCESS;
3+
---> urAdapterGet(.NumEntries = 1, .phAdapters = {{.*}}, .pNumAdapters = nullptr) -> UR_RESULT_SUCCESS;
4+
---> urPlatformGet(.phAdapters = {{.*}}, .NumAdapters = 1, .NumEntries = 1, .phPlatforms = {{.*}}, .pNumPlatforms = {{.*}} (1)) -> UR_RESULT_SUCCESS;
5+
---> urPlatformGet(.phAdapters = {{.*}}, .NumAdapters = 1, .NumEntries = 1, .phPlatforms = {{.*}}, .pNumPlatforms = nullptr) -> UR_RESULT_SUCCESS;
6+
---> urPlatformGetApiVersion(.hPlatform = {{.*}}, .pVersion = {{.*}} ({{0\.[0-9]+}})) -> UR_RESULT_SUCCESS;
7+
API version: {{0\.[0-9]+}}
8+
---> urDeviceGet(.hPlatform = {{.*}}, .DeviceType = UR_DEVICE_TYPE_GPU, .NumEntries = 0, .phDevices = {}, .pNumDevices = {{.*}} (1)) -> UR_RESULT_SUCCESS;
9+
---> urDeviceGet(.hPlatform = {{.*}}, .DeviceType = UR_DEVICE_TYPE_GPU, .NumEntries = 1, .phDevices = {{.*}}, .pNumDevices = nullptr) -> UR_RESULT_SUCCESS;
10+
---> urDeviceGetInfo(.hDevice = {{.*}}, .propName = UR_DEVICE_INFO_TYPE, .propSize = 4, .pPropValue = {{.*}} (UR_DEVICE_TYPE_GPU), .pPropSizeRet = nullptr) -> UR_RESULT_SUCCESS;
11+
---> urDeviceGetInfo(.hDevice = {{.*}}, .propName = UR_DEVICE_INFO_NAME, .propSize = {{.*}}, .pPropValue = {{.*}} (Null Device), .pPropSizeRet = nullptr) -> UR_RESULT_SUCCESS;
12+
Found a Null Device gpu.
13+
---> urAdapterRelease(.hAdapter = {{.*}}) -> UR_RESULT_SUCCESS;

0 commit comments

Comments
 (0)