From 980160ff0f619b7e81c6b8cfce00b42f534c0575 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sun, 11 Jan 2026 10:32:00 -0800 Subject: [PATCH] Add bootstrap check to test/runner.py. NFC See https://github.com/emscripten-core/emscripten/pull/26081#issuecomment-3735252785 --- test/runner.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/runner.py b/test/runner.py index f081c0468e651..62e1ab378be76 100755 --- a/test/runner.py +++ b/test/runner.py @@ -51,6 +51,18 @@ logger = logging.getLogger("runner") +# In git checkouts of emscripten `bootstrap.py` exists to run post-checkout +# steps. In packaged versions (e.g. emsdk) this file does not exist (because +# it is excluded in tools/install.py) and these steps are assumed to have been +# run already. +if os.path.exists('.git') and os.path.exists('bootstrap.py'): + import bootstrap + bootstrap.check() +else: + # The test framework depends on writing files to the `out/` directory. + # For git checkouts the bootstrap.py script would take care of creating this. + os.makedirs('out', exist_ok=True) + # Test modes from 'core' that fully pass all tests. When running a random # selection of tests (e.g. "random100" runs 100 random tests) they will be @@ -428,7 +440,6 @@ def run_tests(options, suites): # Run the discovered tests if os.getenv('CI'): - os.makedirs('out', exist_ok=True) # output fd must remain open until after testRunner.run() below output = open('out/test-results.xml', 'wb') import xmlrunner # type: ignore # noqa: PLC0415