Skip to content

Commit 0287ee5

Browse files
RossBruntonkbenzie
authored andcommitted
Move non-conformance/adapter tests to lit (#17580)
This adds support for lit to unified-runtime, in the form of a new target `check-unified-runtime`. This target is available when UR is built standalone and when built as part of dpcpp. In addition, there are targets like `check-unified-runtime-unit` which run a subset of the lit tests. When built standalone, `lit` and `filecheck` must be avilable in the path. A `requirements_testing.txt` file is available to install test dependencies. When built as part of dpcpp, a new cmake variable is available; `SYCL_UR_BUILD_TESTS` which is off by default. When enabled, `check-unified-runtime` will be available as a target and will also run as part of `check-all`. All tests have been ported with the exception of: * Adapter tests * Conformance tests The Python version for macos was also bumped to 3.10 to enable use of a newer filecheck version.
1 parent 0d93b08 commit 0287ee5

File tree

109 files changed

+1001
-1617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1001
-1617
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,29 @@ List of options provided by CMake:
148148
| UR_HIP_HSA_INCLUDE_DIRS | Path of the ROCm HSA include directory | Directory path | `${UR_HIP_ROCM_DIR}/hsa/include;${UR_HIP_ROCM_DIR}/include` |
149149
| UR_HIP_LIB_DIR | Path of the ROCm HIP library directory | Directory path | `${UR_HIP_ROCM_DIR}/lib` |
150150

151-
### Additional make targets
151+
### Testing
152152

153-
To run tests, do the following:
153+
Unified Runtime uses `lit` and `FileCheck` as part of its test suite. When built as
154+
part of an LLVM build, the binaries provided by LLVM will be used. When built standalone,
155+
both `lit` and `FileCheck` (or `filecheck`) must be visible on `$PATH`. The easiest way
156+
to do this is to install the Python packages for `lit` and `filecheck`.
157+
158+
```bash
159+
$ source .venv/bin/activate
160+
$ pip install -r third_party/requirements_testing.txt
161+
```
162+
163+
> Note: `filecheck` requires Python >= 3.10; if you get errors claiming that `filecheck` is not available, update your Python version or disable testing.
164+
165+
Once installed, tests can be executed using:
154166

155167
```bash
156168
$ make
157169
$ make test
158170
```
159171

172+
### Additional make targets
173+
160174
To run automated code formatting, configure CMake with `UR_FORMAT_CPP_STYLE` option
161175
and then run a custom `cppformat` target:
162176

cmake/FindLit.cmake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (C) 2025 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+
7+
# There are two modes to finding lit and filecheck
8+
# If we are a standalone build, use the python packages
9+
# If we are not a standalone build, use the one provided by LLVM
10+
# Note that the python filecheck re-implementation isn't 100% compatible, but hopefully for simple tests it should be
11+
# good enough
12+
13+
if(UR_STANDALONE_BUILD)
14+
# Standalone build
15+
find_program(URLIT_LIT_BINARY "lit")
16+
if(NOT URLIT_LIT_BINARY)
17+
message(FATAL_ERROR "No `lit` binary was found in path. Consider installing the python Package `lit`")
18+
endif()
19+
20+
find_program(URLIT_FILECHECK_BINARY NAMES "filecheck" "FileCheck")
21+
if(NOT URLIT_FILECHECK_BINARY)
22+
message(FATAL_ERROR "No `filecheck` or `FileCheck` binary was found in path. Consider installing the python Package `filecheck`")
23+
endif()
24+
else()
25+
# In source build
26+
27+
# This will be in the $PATH
28+
set(URLIT_FILECHECK_BINARY "FileCheck")
29+
endif()

cmake/match.cmake

Lines changed: 0 additions & 77 deletions
This file was deleted.

cmake/match.py

Lines changed: 0 additions & 254 deletions
This file was deleted.

0 commit comments

Comments
 (0)