Skip to content

Commit 5ec5bd4

Browse files
committed
Enable validation on conformance tests for platform.
Also necessitates splitting urInit/urTearDown into their own suite due to how they currently work WRT global state.
1 parent e002ca8 commit 5ec5bd4

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

test/conformance/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ endfunction()
4646

4747
add_subdirectory(testing)
4848

49+
add_subdirectory(runtime)
4950
add_subdirectory(platform)
5051
add_subdirectory(device)
5152
add_subdirectory(context)

test/conformance/platform/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

66
add_conformance_test(platform
7-
urInit.cpp
87
urPlatformCreateWithNativeHandle.cpp
98
urPlatformGet.cpp
109
urPlatformGetApiVersion.cpp
1110
urPlatformGetBackendOption.cpp
1211
urPlatformGetInfo.cpp
1312
urPlatformGetLastError.cpp
14-
urPlatformGetNativeHandle.cpp
15-
urTearDown.cpp)
13+
urPlatformGetNativeHandle.cpp)

test/conformance/platform/fixtures.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ struct urTest : ::testing::Test {
1414

1515
void SetUp() override {
1616
ur_device_init_flags_t device_flags = 0;
17-
ASSERT_SUCCESS(urInit(device_flags, nullptr));
17+
ur_loader_config_handle_t config;
18+
ASSERT_SUCCESS(urLoaderConfigCreate(&config));
19+
ASSERT_SUCCESS(
20+
urLoaderConfigEnableLayer(config, "UR_LAYER_FULL_VALIDATION"));
21+
ASSERT_SUCCESS(urInit(device_flags, config));
22+
ASSERT_SUCCESS(urLoaderConfigRelease(config));
1823
}
1924

2025
void TearDown() override {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (C) 2023 Intel Corporation
2+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
3+
# See LICENSE.TXT
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
add_conformance_test(runtime
7+
urInit.cpp
8+
urTearDown.cpp)

0 commit comments

Comments
 (0)