From bf7022f71a95313e8ebdd34e5ea7cb7bca90a24d Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Mon, 7 Oct 2024 13:19:08 +0100 Subject: [PATCH] [clang][python] Add CLANG_DISABLE_RUN_PYTHON_TESTS CMake option to disable clang python bindings tests We already have hard-coded logic to disable adding these tests to the `check-all` target in various cases. It's handy to have a CMake option to disable if in an environment where the tests don't work and you want `check-all` to work as expected. --- clang/bindings/python/tests/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clang/bindings/python/tests/CMakeLists.txt b/clang/bindings/python/tests/CMakeLists.txt index 2543cf739463d..b97195c24d62b 100644 --- a/clang/bindings/python/tests/CMakeLists.txt +++ b/clang/bindings/python/tests/CMakeLists.txt @@ -47,6 +47,12 @@ if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|Sparc|SystemZ)$") set(RUN_PYTHON_TESTS FALSE) endif() +# Allow user to explicitly disable these tests. +option(CLANG_DISABLE_RUN_PYTHON_TESTS "Do not run Clang Python bindings tests" OFF) +if(CLANG_DISABLE_RUN_PYTHON_TESTS) + set(RUN_PYTHON_TESTS FALSE) +endif() + if(RUN_PYTHON_TESTS) set_property(GLOBAL APPEND PROPERTY LLVM_ALL_ADDITIONAL_TEST_TARGETS check-clang-python)