Skip to content

Commit

Permalink
Merge pull request #114 from stanislaw/ci-windows-steps
Browse files Browse the repository at this point in the history
 tasks: switch to passing parameters to lit with "--param"
  • Loading branch information
stanislaw authored Apr 11, 2020
2 parents 0541523 + e48af51 commit f6c331e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 4 additions & 6 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ def run_lit_tests(c, filecheck_exec, llvm_only):
cwd = os.getcwd()

command = formatted_command("""
CURRENT_DIR={cwd}
REAL_ONLY={llvm_only_value} \
FILECHECK_EXEC={filecheck_exec}
PATH={cwd}/tests/integration/tools/FileCheck:{cwd}/tests/integration/tools:$PATH
lit
-vv
lit
--param REAL_ONLY={llvm_only_value}
--param FILECHECK_EXEC={filecheck_exec}
-v
{cwd}/tests/integration
""").format(cwd=cwd, filecheck_exec=filecheck_exec, llvm_only_value=llvm_only_value)

Expand Down
13 changes: 8 additions & 5 deletions tests/integration/lit.cfg
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import os

import lit.formats

config.name = "FileCheck.py integration tests"
config.test_format = lit.formats.ShTest("0")

current_dir = os.getcwd()

# LLVM LIT: Is it possible to pass user defined parameter into a test script?
# https://stackoverflow.com/a/39861848/598057
current_dir = os.environ.get('CURRENT_DIR', '')
filecheck_exec = os.environ.get('FILECHECK_EXEC', '')
real_only = os.environ.get('REAL_ONLY', '')
filecheck_exec = lit_config.params['FILECHECK_EXEC']
assert(filecheck_exec)

real_only = lit_config.params['REAL_ONLY']

config.substitutions.append(('%CURRENT_DIR', current_dir))
config.substitutions.append(('%FILECHECK_EXEC', filecheck_exec))
config.substitutions.append(('%COMPARE_EXEC', "{}/tests/integration/tools/compare_dirs".format(current_dir)))
config.substitutions.append(('%FILECHECK_TESTER_EXEC', "{}/tests/integration/tools/FileCheck/FileCheck".format(current_dir)))

if real_only:
Expand Down

0 comments on commit f6c331e

Please sign in to comment.