Skip to content

Commit 057b52a

Browse files
authored
Merge pull request #1303 from szadam/count
Fix counting variables for CTS
2 parents 4d395a3 + 31c7ca0 commit 057b52a

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ FetchContent_Declare(
99
GIT_REPOSITORY https://github.com/google/googletest.git
1010
GIT_TAG release-1.12.1
1111
)
12+
13+
set(UR_TEST_DEVICES_COUNT 1 CACHE STRING "Count of devices on which conformance and adapters tests will be run")
14+
set(UR_TEST_PLATFORMS_COUNT 1 CACHE STRING "Count of platforms on which conformance and adapters tests will be run")
1215
# For Windows: Prevent overriding the parent project's compiler/linker settings
1316
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
1417
FetchContent_MakeAvailable(googletest)

test/adapters/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ function(add_adapter_test name)
3131
${PROJECT_NAME}::common
3232
GTest::gtest)
3333

34-
add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}>)
34+
add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}>
35+
--devices_count=${UR_TEST_DEVICES_COUNT}
36+
--platforms_count=${UR_TEST_DEVICES_COUNT})
3537
set_tests_properties(${target} PROPERTIES
3638
LABELS "adapter-specific;${name}"
3739
ENVIRONMENT "${args_ENVIRONMENT}")

test/conformance/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

66
set(UR_CONFORMANCE_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
7-
option(UR_TEST_DEVICES_COUNT "Count of devices on which CTS will be run" 1)
8-
option(UR_TEST_PLATFORMS_COUNT "Count of platforms on which CTS will be run" 1)
97

108
function(add_test_adapter name adapter)
119
set(TEST_TARGET_NAME test-${name})

test/conformance/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ in a particular group for the corresponding adapter.
1212

1313
## How to set test device/platform name or limit the test devices/platforms count
1414

15-
To limit how many devices/platforms you want to run the CTS on,
16-
use CMake option UR_TEST_DEVICES_COUNT or
15+
To limit how many devices/platforms you want to run the conformance and
16+
adapters tests on, use CMake option UR_TEST_DEVICES_COUNT or
1717
UR_TEST_PLATFORMS_COUNT. If you want to run the tests on
1818
all available devices/platforms, set 0. The default value is 1.
1919
If you run binaries for the tests, you can use the parameter
2020
`--platforms_count=COUNT` or `--devices_count=COUNT`.
21-
To set test device/platform name you want to run the CTS on, use
21+
To set test device/platform name you want to run the tests on, use
2222
parameter `--platform=NAME` or `--device=NAME`.

0 commit comments

Comments
 (0)