Repository navigation
test: eight checks say which compiler or module they need - #2103
Conversation
|
Heads-up: this conflicts with main now. Could you rebase onto main and resolve the conflicts? Thanks! |
On a PC with g++ and no clang, or without the zstandard module, tests/run_all.py reported eight failures that are not
failures of the source: five C++ checks and two C checks start their own default compiler (clang++, clang) without
saying so, and nx2/test_nup_read_name.py imports zstandard without saying so, so the runner could neither give them
the compiler it found nor skip them.
The five C++ checks take the runner's compiler ({cxx}: clang++ where there is one, as before, else g++; all five pass
with g++ 15 here). The two C checks name clang and the module check names zstandard, so each is skipped with its
reason where that is missing, and fails with --strict as CI runs it. Nothing changes where clang and zstandard are
installed.
eb26cb7 to
ce7fa41
Compare
|
Rebased onto main. Main had already given tests/test_prepare_cache_save.py its line in #1980, so this now covers eight checks; title and text updated. |
Joey-Magnus
left a comment
There was a problem hiding this comment.
Looks good. Each of the eight files now declares what it needs, in the form run_all.py reads (a top-level literal after the imports). Each test's argparse already accepts the flag it's handed: --cxx on the five C++ ones, --cc on the two C ones. With clang and zstandard installed, the runner passes the same compiler the tests defaulted to, so CI behaviour doesn't change. None of these files has a declaration on main yet, so nothing here is superseded. I ran the eight plus test_run_all_declarations on this head on Linux, and all nine pass.
About the red CI on this head (not caused by the PR): the run started at 16:40 UTC. The Windows failures are tests/test_vcore_fs_open.py and tests/test_vcore_video_acquire.py, which this PR doesn't touch. Main broke both of them at 11:35 (#2301 and #2322) and fixed them at 12:05 (#2380), and this run landed inside that window. The Ubuntu, SPIR-V and AppImage jobs failed in the apt step (exit 100, a DNS outage), before any test ran. A rerun, or a no-op rebase, should come back green.
minor (optional follow-up): tests/test_nvn_null_pool.py:21 and tests/test_nvn_tex_builder_guard.py:20 declare ["--cc", "clang"]. On a gcc-only machine both are now skipped, even though their help text says they work with gcc too. That's still a clear improvement over failing. run_all.py has no {cc} placeholder yet, so the gcc case would need a C compiler added to find_tools(). That belongs in its own PR, not this one.
Eight checks fail on any PC without clang or the zstandard module, instead of using the compiler
run_all.pyfound or being skipped. Five C++ tests default toclang++and two C tests toclangwithout aRUN_ALL_ARGSline (for exampletests/test_3d_view_create_flags.pyandtests/test_nvn_null_pool.py), andnx2/test_nup_read_name.pyimportszstandardwithoutRUN_ALL_MODULES.run_all.pyonly checks the tools a test names, so it can neither hand these its compiler nor skip them, and on a g++-only box they show as failures.Each now declares what it needs:
RUN_ALL_ARGS = ["--cxx", "{cxx}"]on the five (the runner's compiler, which is still clang++ where it is installed),["--cc", "clang"]on the two C ones, andRUN_ALL_MODULES = ["zstandard"]on the last. Nothing changes where clang and zstandard are installed, as on CI.tests/test_prepare_cache_save.pywas a sixth C++ one; main gave it the same line in #1980, so it is no longer part of this.Testing (Linux, g++ 15, no clang, no zstandard): after the rebase, the eight through
run_all.py: the five C++ tests pass with g++, and the other three are skipped with their reason. Before the rebase,tests/test_run_all_declarations.pypassed, and the fullrun_all.pygave 298 passed, 61 skipped, with the only failures the two that #2109 has since fixed on main.