Skip to content

Commit 64f5d11

Browse files
committed
use config command instead of env var
1 parent dcc9b4a commit 64f5d11

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

mlir/test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ if (MLIR_INCLUDE_INTEGRATION_TESTS)
6565

6666
endif()
6767

68+
option(MLIR_RUN_STANDALONE_INSTALL_TESTS "Run Standalone example install tests." ON)
69+
if(MLIR_RUN_STANDALONE_INSTALL_TESTS AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "")
70+
message(WARNING "Standalone example install tests will install into root!\
71+
If you want to disable this behavior pass -DMLIR_RUN_STANDALONE_INSTALL_TESTS=OFF")
72+
endif()
73+
6874
llvm_canonicalize_cmake_booleans(
6975
LLVM_BUILD_EXAMPLES
7076
LLVM_HAS_NVPTX_TARGET
@@ -76,6 +82,7 @@ llvm_canonicalize_cmake_booleans(
7682
MLIR_ENABLE_SPIRV_CPU_RUNNER
7783
MLIR_ENABLE_VULKAN_RUNNER
7884
MLIR_INCLUDE_INTEGRATION_TESTS
85+
MLIR_RUN_STANDALONE_INSTALL_TESTS
7986
MLIR_RUN_AMX_TESTS
8087
MLIR_RUN_CUDA_TENSOR_CORE_TESTS
8188
MLIR_RUN_X86VECTOR_TESTS

mlir/test/Examples/standalone/lit.local.cfg

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ config.substitutions.append(("%cmake_build_type", config.cmake_build_type))
1717
config.substitutions.append(("%cmake_c_compiler_launcher", config.cmake_c_compiler_launcher))
1818
config.substitutions.append(("%cmake_cxx_compiler_launcher", config.cmake_cxx_compiler_launcher))
1919

20-
# see https://github.com/llvm/llvm-project/blob/57782eff31e9d454b54a201c7ac43dc1b93dbb3f/llvm/utils/lit/lit/TestRunner.py#L1858
21-
config.substitutions.insert(0, ("FileCheck", "FileChuck"))
22-
config.substitutions.insert(0, ("count", "kount"))
23-
config.substitutions.insert(0, ("not", "mot"))
24-
config.substitutions.append(("kount", "count"))
25-
config.substitutions.append(("mot", "not"))
26-
config.substitutions.append(("FileChuck", "FileCheck"))
20+
if config.run_standalone_install_tests:
21+
config.available_features.add("run-standalone-install-tests")
22+
# see https://github.com/llvm/llvm-project/blob/57782eff31e9d454b54a201c7ac43dc1b93dbb3f/llvm/utils/lit/lit/TestRunner.py#L1858
23+
config.substitutions.insert(0, ("FileCheck", "FileChuck"))
24+
config.substitutions.insert(0, ("count", "kount"))
25+
config.substitutions.insert(0, ("not", "mot"))
26+
config.substitutions.append(("kount", "count"))
27+
config.substitutions.append(("mot", "not"))
28+
config.substitutions.append(("FileChuck", "FileCheck"))

mlir/test/Examples/standalone/test.install-dir.toy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# REQUIRES: github-actions
1+
# REQUIRES: run-standalone-install-tests
22

33
# RUN: echo "test full install" | tee %t
44
# CHECK: test full install

mlir/test/lit.cfg.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,3 @@ def have_host_jit_feature_support(feature_name):
383383

384384
if sys.version_info >= (3, 11):
385385
config.available_features.add("python-ge-311")
386-
387-
if "GITHUB_ACTIONS" in os.environ:
388-
config.available_features.add("github-actions")

mlir/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ config.build_examples = @LLVM_BUILD_EXAMPLES@
3636
config.run_nvptx_tests = @LLVM_HAS_NVPTX_TARGET@
3737
config.enable_cuda_runner = @MLIR_ENABLE_CUDA_RUNNER@
3838
config.run_rocm_tests = @MLIR_ENABLE_ROCM_CONVERSIONS@
39+
config.run_standalone_install_tests = @MLIR_RUN_STANDALONE_INSTALL_TESTS@
3940
config.enable_rocm_runner = @MLIR_ENABLE_ROCM_RUNNER@
4041
config.gpu_compilation_format = "@MLIR_GPU_COMPILATION_TEST_FORMAT@"
4142
config.rocm_test_chipset = "@ROCM_TEST_CHIPSET@"

0 commit comments

Comments
 (0)