INVESTIGATION.md
The user reported that C++ unit tests, when run with bash test --cpp --clean, were not propagating errors up to test.py, often showing "0/1 runs" despite an underlying failure.
Analyzed test script: The test script (located at C:\Users\niteris\dev\fastled10\test) is a simple bash script that executes uv run test.py "$@". This means all arguments, including --cpp and --clean, are passed directly to test.py.
Analyzed test.py:
test.py is the main test runner.ci.util.test_runner.runner to orchestrate test execution.try...except SystemExit block in its main function to catch failures and set a tests_passed flag, ultimately exiting with a non-zero status code if tests_passed is False.Analyzed ci/util/test_runner.py:
runner function in this file determines test categories and, for C++ unit tests, delegates to ci.util.meson_runner.run_meson_build_and_test.run_meson_build_and_test to return a MesonTestResult object, and if result.success is False, it calls sys.exit(1).Analyzed ci/util/meson_runner.py:
run_meson_build_and_test function orchestrates the process:
--clean flag by removing the build directory, forcing a full rebuild.setup_meson_build for Meson configuration.compile_meson for compilation. This function uses RunningProcess to execute meson compile and checks its returncode. If compilation fails (non-zero returncode), it returns False.run_meson_test for test execution. This function uses RunningProcess to execute meson test, parses its output to count passed/failed tests, and returns MesonTestResult(success=False, ...) if tests fail or meson test exits with a non-zero code.run_meson_build_and_test returns a MesonTestResult with success=False.Injected a Failing Test: To confirm error propagation, a simple failing TEST_CASE (CHECK(1 == 2);) was temporarily added to tests/doctest_main.cpp.
Executed bash test --cpp --clean with Failing Test:
doctest_main.cpp file was compiled.[MESON] Streaming test execution complete: section reported:
Tests run: 1Passed: 0Failed: 1[MESON] ❌ Some tests failed (0/1 tests in X.XXs).run_shell_command tool reported Exit Code: 1.The investigation confirms that the error is propagating correctly from the C++ unit test (via doctest) through the Meson build system, ci/util/meson_runner.py, ci/util/test_runner.py, and finally to test.py, which then exits with a non-zero status code (1) to the shell.
The initial observation of "0/1 runs" was likely due to:
meson test could categorize as a "run" (e.g., a crash before test execution could begin).--clean flag successfully bypasses).The current test infrastructure correctly identifies and propagates C++ unit test failures.
The temporary failing test case in tests/doctest_main.cpp has been removed.