Skip to content

Commit 7c9c3ff

Browse files
committed
Check for all of the tools
1 parent 867a686 commit 7c9c3ff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/test_jit_stencils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@
1414
_TOOLS_JIT_TEST_TEST_EXECUTOR_CASES_C_H = _TOOLS_JIT_TEST / "test_executor_cases.c.h"
1515
_TOOLS_JIT_BUILD_PY = _TOOLS_JIT / "build.py"
1616

17+
# Skip this test if either the JIT build scripts or the needed LLVM utilities
18+
# are missing:
1719
test.test_tools.skip_if_missing("jit")
1820
with test.test_tools.imports_under_tool("jit"):
1921
import _llvm
22+
for tool in ["clang", "llvm-objdump", "llvm-readobj"]:
23+
if not asyncio.run(_llvm._find_tool(tool)):
24+
raise unittest.SkipTest(f"{tool} {_llvm._LLVM_VERSION} isn't installed.")
2025

2126
@test.support.cpython_only
2227
@unittest.skipIf(test.support.Py_DEBUG, "Debug stencils aren't tested.")
@@ -60,8 +65,6 @@ def _check_jit_stencils(
6065
raise
6166

6267
def test_jit_stencils(self):
63-
if not asyncio.run(_llvm._find_tool("clang")):
64-
self.skipTest(f"LLVM {_llvm._LLVM_VERSION} isn't installed.")
6568
self.maxDiff = None
6669
found = False
6770
for test_jit_stencils_h in _TOOLS_JIT_TEST.glob("test_jit_stencils-*.h"):

0 commit comments

Comments
 (0)