Skip to content

Commit d629065

Browse files
authored
[UR] In CTS, "AllDevices" test now skip if the platform has no devices (#18567)
Some platforms don't provide any devices. For test fixtures that provide a device list to the test itself, this used to result in a failure. Now the test is just skipped.
1 parent 79dd8f8 commit d629065

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

unified-runtime/test/conformance/testing/include/uur/fixtures.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct urAllDevicesTest : urPlatformTest {
6666
UUR_RETURN_ON_FATAL_FAILURE(urPlatformTest::SetUp());
6767
auto devicesPair = GetDevices(platform);
6868
if (!devicesPair.first) {
69-
FAIL() << "Failed to get devices";
69+
GTEST_SKIP() << "No devices available";
7070
}
7171
devices = std::move(devicesPair.second);
7272
}
@@ -133,7 +133,7 @@ struct urAllDevicesTestWithParam : urPlatformTestWithParam<T> {
133133
UUR_RETURN_ON_FATAL_FAILURE(urPlatformTestWithParam<T>::SetUp());
134134
auto devicesPair = GetDevices(this->platform);
135135
if (!devicesPair.first) {
136-
FAIL() << "Failed to get devices";
136+
GTEST_SKIP() << "No devices available";
137137
}
138138
devices = std::move(devicesPair.second);
139139
}

unified-runtime/test/layers/validation/fixtures.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ struct valAllDevicesTest : valPlatformTest {
104104
uint32_t count = 0;
105105
if (urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, nullptr, &count) ||
106106
count == 0) {
107-
FAIL() << "Failed to get devices";
107+
GTEST_SKIP() << "No devices available";
108+
return;
108109
}
109110

110111
devices.resize(count);

0 commit comments

Comments
 (0)