[mlir] [test] Include mlir_tools_dir in PATH to fix mlir-reduce
authorMichał Górny <mgorny@moritz.systems>
Sat, 2 Oct 2021 09:59:15 +0000 (11:59 +0200)
committerMichał Górny <mgorny@moritz.systems>
Sun, 3 Oct 2021 06:48:59 +0000 (08:48 +0200)
Include mlir_tools_dir in the PATH used in test environment,
as otherwise mlir-reduce is unable to find mlir-opt when building
standalone (and hence mlir_tools_dir != llvm_tools_dir).

Differential Revision: https://reviews.llvm.org/D110992

mlir/test/lit.cfg.py

index 2307192..bcb40cc 100644 (file)
@@ -51,6 +51,7 @@ config.test_source_root = os.path.dirname(__file__)
 config.test_exec_root = os.path.join(config.mlir_obj_root, 'test')
 
 # Tweak the PATH to include the tools dir.
+llvm_config.with_environment('PATH', config.mlir_tools_dir, append_path=True)
 llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
 
 tool_dirs = [config.mlir_tools_dir, config.llvm_tools_dir]