Skip to content

Commit 1dbcb79

Browse files
committed
[lit] Test changes to make it work with bazel
These non-functional changes will make it easier to add the lit tests to the bazel build (see utils/bazel). Reviewed By: bkramer Differential Revision: https://reviews.llvm.org/D133416
1 parent 3864643 commit 1dbcb79

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

llvm/utils/lit/tests/lit.cfg

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ if llvm_src_root:
3535
lit_path = os.path.join(llvm_src_root, 'utils', 'lit')
3636
else:
3737
lit_path = os.path.join(config.test_source_root, '..')
38+
lit_path = os.path.abspath(lit_path)
3839

3940
# Required because some tests import the lit module
4041
if llvm_config:
4142
llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True)
4243
else:
43-
config.environment['PYTHONPATH'] = os.pathsep.join([lit_path])
44+
config.environment['PYTHONPATH'] = lit_path
4445
# Do not add user-site packages directory to the python search path. This avoids test failures if there's an
4546
# incompatible lit module installed inside the user-site packages directory, as it gets prioritized over the lit
4647
# from the PYTHONPATH.
@@ -60,8 +61,7 @@ for attribute in ('llvm_tools_dir', 'lit_tools_dir'):
6061
# that can affect FileCheck's output. It also includes "--order=lexical -j1"
6162
# to ensure predictable test order, as it is often required for FileCheck
6263
# matches.
63-
config.substitutions.append(('%{inputs}', os.path.join(
64-
config.test_source_root, 'Inputs')))
64+
config.substitutions.append(('%{inputs}', 'Inputs'))
6565
config.substitutions.append(('%{lit}', '%{lit-no-order-opt} --order=lexical'))
6666
config.substitutions.append(('%{lit-no-order-opt}',
6767
"{env} %{{python}} {lit} -j1".format(

llvm/utils/lit/tests/reorder.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
## Check that we can reorder test runs.
22

3-
# RUN: cp %{inputs}/reorder/.lit_test_times.txt %{inputs}/reorder/.lit_test_times.txt.orig
3+
# RUN: cp %{inputs}/reorder/lit_test_times %{inputs}/reorder/.lit_test_times.txt
44
# RUN: not %{lit-no-order-opt} %{inputs}/reorder > %t.out
5-
# RUN: cp %{inputs}/reorder/.lit_test_times.txt %{inputs}/reorder/.lit_test_times.txt.new
6-
# RUN: cp %{inputs}/reorder/.lit_test_times.txt.orig %{inputs}/reorder/.lit_test_times.txt
7-
# RUN: not diff %{inputs}/reorder/.lit_test_times.txt.new %{inputs}/reorder/.lit_test_times.txt.orig
8-
# RUN: FileCheck --check-prefix=TIMES --implicit-check-not= < %{inputs}/reorder/.lit_test_times.txt.new %s
5+
# RUN: FileCheck --check-prefix=TIMES < %{inputs}/reorder/.lit_test_times.txt %s
96
# RUN: FileCheck < %t.out %s
107
# END.
118

mlir/test/lit.cfg.py

+2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@
6666
'mlir-cpu-runner',
6767
'mlir-linalg-ods-yaml-gen',
6868
'mlir-reduce',
69+
'mlir-spirv-cpu-runner',
6970
'mlir-pdll',
71+
'not',
7072
]
7173

7274
# The following tools are optional

0 commit comments

Comments
 (0)