Fix LLVM test to use %python instead of python

This uses lit substitution, which fixes running this test on
some environment where 'python' isn't in the path.
This commit is contained in:
Mehdi Amini
2025-12-01 05:50:31 -08:00
parent aa04b654b4
commit 235d44d8b6
2 changed files with 2 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ lit_path = os.path.abspath(lit_path)
# Required because some tests import the lit module
if llvm_config:
llvm_config.use_default_substitutions()
llvm_config.with_environment("PYTHONPATH", lit_path, append_path=True)
else:
config.environment["PYTHONPATH"] = lit_path

View File

@@ -1,7 +1,7 @@
# Create a directory with 20 files and check the number of pools and workers per pool that lit will use.
# RUN: rm -Rf %t.dir && mkdir -p %t.dir
# RUN: python -c "for i in range(20): open(rf'%t.dir/file{i}.txt', 'w').write('RUN:')"
# RUN: %python -c "for i in range(20): open(rf'%t.dir/file{i}.txt', 'w').write('RUN:')"
# RUN: echo "import lit.formats" > %t.dir/lit.cfg
# RUN: echo "config.name = \"top-level-suite\"" >> %t.dir/lit.cfg