Skip to content

Commit 6a07dfd

Browse files
committed
[NFC] Remove "dependencies" on tests
CMake's `add_test` doesn't actually support a `DEPENDS` parameter, so removed it. Also updated the README with instructionts on running the tests which explicitly calls out that you should run `make` before the tests.
1 parent 28c402f commit 6a07dfd

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ List of options provided by CMake:
155155

156156
### Additional make targets
157157

158+
To run tests, do the following:
159+
160+
```bash
161+
$ make
162+
$ make test
163+
```
164+
158165
To run automated code formatting, configure CMake with `UR_FORMAT_CPP_STYLE` option
159166
and then run a custom `cppformat` target:
160167

test/adapters/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ function(add_adapter_memcheck_test name)
6767
-D MODE=stderr
6868
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${name}_memcheck.match
6969
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
70-
DEPENDS ${TEST_TARGET_NAME}
7170
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7271
)
7372

test/conformance/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function(add_test_adapter name adapter backend)
3434
separate_arguments(TEST_COMMAND)
3535
add_test(NAME ${tname}
3636
COMMAND ${TEST_COMMAND}
37-
DEPENDS ${TEST_TARGET_NAME}
3837
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
3938
)
4039
endif()

test/layers/tracing/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ add_test(NAME example-collected-hello-world
3838
-D TEST_FILE=$<TARGET_FILE:hello_world>
3939
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/hello_world.out.match
4040
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
41-
DEPENDS collector hello_world
4241
)
4342

4443
set_tracing_test_props(example-collected-hello-world collector)
@@ -49,7 +48,6 @@ add_test(NAME example-logged-hello-world
4948
-D TEST_FILE=$<TARGET_FILE:hello_world>
5049
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/hello_world.out.logged.match
5150
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
52-
DEPENDS hello_world
5351
)
5452
set_tests_properties(example-logged-hello-world PROPERTIES LABELS "tracing")
5553
set_property(TEST example-logged-hello-world PROPERTY ENVIRONMENT
@@ -73,7 +71,6 @@ function(add_tracing_test name)
7371
-D TEST_FILE=$<TARGET_FILE:${TEST_TARGET_NAME}>
7472
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${name}.out.match
7573
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
76-
DEPENDS test_collector
7774
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7875
)
7976
set_tracing_test_props(${name} test_collector)

test/loader/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
add_test(NAME example-hello-world COMMAND hello_world DEPENDS hello_world)
6+
add_test(NAME example-hello-world COMMAND hello_world)
77
set_tests_properties(example-hello-world PROPERTIES LABELS "loader"
88
ENVIRONMENT "UR_ADAPTERS_FORCE_LOAD=\"$<TARGET_FILE:ur_adapter_mock>\""
99
)

test/loader/platforms/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function(add_loader_platform_test name ENV)
2525
-D MODE=stdout
2626
-D MATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${name}.match
2727
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
28-
DEPENDS test-loader-platforms ur_adapter_mock
2928
)
3029
set_tests_properties(${TEST_NAME} PROPERTIES
3130
LABELS "loader"

test/tools/urtrace/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function(add_trace_test name CLI_ARGS)
1919
-D MODE=stdout
2020
-D MATCH_FILE=${CMAKE_CURRENT_BINARY_DIR}/${name}.match
2121
-P ${PROJECT_SOURCE_DIR}/cmake/match.cmake
22-
DEPENDS ur_trace_cli hello_world
2322
)
2423
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "urtrace")
2524
endfunction()

0 commit comments

Comments
 (0)