Skip to content

test: make output-delay failure diagnostics link on Windows - #1591

Merged
zackees merged 2 commits into
masterfrom
fix/1580-output-delay-cmocka-link
Oct 21, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/1580-output-delay-cmocka-link

Conversation

@zackees

@zackees zackees commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #1580. Repair the output-delay end-to-end test's failure diagnostics on Windows without weakening its checks.

RED

9b26081 adds ci/test_output_delay_diagnostics.py. The focused regression has two failures: private-printer use remains, and compiling the actual diagnostic helpers without a cm_print_error definition reproduces the unresolved-symbol link failure. This models the observed Windows dependency contract; native Windows Tier 2 is still required for proof with its actual library.

Existing native failure: full run 39524526040, Windows Tier 2 job 118977902779, LNK2019 cm_print_error in check_delivered, before tests execute. Its package installation records cmocka 2.0.2. Other repo tests already print via stdio followed by plain fail to avoid this diagnostic dependency. Current cmocka header documentation also uses the renamed public diagnostic API; no dependency upgrade or global header-selection change is proposed here.

GREEN and validation

cf69fc1 uses the same compatibility pattern as other existing tests: fprintf(stderr, ...) followed by plain fail. The five conditions and message arguments are preserved, with a terminating newline.

  • Two focused regression tests pass. The compiled fixture uses actual diagnostic helper bodies and forces all five failures (timeout, packet order, too-early delivery, missing packet, unsent pre-stop packet); each prints its expected diagnostic and fails. A valid snapshot succeeds.
  • All 55 existing assertion and case-registration calls are unchanged. No deadlines, delays, test cases, comparison conditions or skip paths changed.
  • Pinned clang-format and whitespace checks pass.
  • Full validation 39526317003 succeeded completely, including all native app/Tier 2 jobs and Flatpak. PR CI 39526304323 succeeded. Native Windows Tier 2 job 118983512820 confirms the executable links and the real output-delay test passes in OFF (C, 9.57 s) and ON (Rust, 9.56 s), with all 165 tests passing in each mode and exported-symbol parity successful. The complete Windows log is retained locally as build_ci_audit/windows1580-tier2.log. This is a test repair, not a Rust port or an accommodation for a port. No production/API change, features-ledger change, new workflow, or WebSocket gitlink change.

@zackees
zackees marked this pull request as ready for review October 21, 2026 01:34
@zackees
zackees added this pull request to the merge queue Oct 21, 2026
Merged via the queue into master with commit c120ac2 Oct 21, 2026
51 checks passed
rdoupe added a commit to rdoupe/obs-studio that referenced this pull request Oct 22, 2026
The Windows Tier 2 build stops before CTest with LNK2019, unresolved
cm_print_error in check_plan: test_video_output_plan (from obs-rust#1714) calls
fail_msg(), which expands to that private cmocka printer, and the Windows
cmocka does not export it. obs-rust#1580 was the same failure in
test_output_delay_e2e; obs-rust#1591 fixed it with fprintf(stderr, ...) and plain
fail(), and added a check for that one file.

ci/test_cmocka_windows_diagnostics.py generalizes that check. It reads
every add_executable() in test/cmocka/CMakeLists.txt and tests.d/*.cmake,
skips the ones an enclosing if() keeps off Windows (OS_LINUX, UNIX,
NOT WIN32, or a plugin target that plugins/CMakeLists.txt only adds on
other platforms; else() counts as Windows), and fails if any of their
sources calls fail_msg(). Comments that mention fail_msg() do not count.
As in obs-rust#1591, it also compiles the actual diagnostic helpers of
test_video_output_plan (check_plan, techniques_exist_in_the_effect,
size_check_edges, output_size_check_edges) against a model of the
Windows link contract, a cm_print_error declaration with no definition,
and expects each forced failure to print its diagnostic and fail.

On master it fails twice: the scan finds four fail_msg() calls in
test_video_output_plan.c and three in test_settings_track_rows.cpp (a
Qt6::Widgets test that Windows builds), and the probe does not link
(undefined reference to cm_print_error in all four helpers).

Refs obs-rust#1713
rdoupe added a commit to rdoupe/obs-studio that referenced this pull request Oct 22, 2026
…them

The Windows cmocka does not export cm_print_error(), which fail_msg()
expands to there, so a Windows-built test that calls it stops the
Windows Tier 2 build with LNK2019 before CTest runs. obs-rust#1741 converted
three of the four calls in test_video_output_plan; the one in
output_size_check_edges (added by obs-rust#1734) is still there, so the
Windows link still fails. The same pattern as obs-rust#1591 for obs-rust#1580: it is
now fprintf(stderr, ...) with the same format and arguments, a
terminating newline, and then a plain fail(), under the same condition.

test_settings_track_rows (Qt6::Widgets only, so Windows builds it too)
had three such calls. It links on Windows today, but it is the only
other Windows-built test that calls fail_msg(), and the new check holds
every such test to the same rule, so it gets the same change.

No condition, loop, case or assertion changes.

Refs obs-rust#1713
rdoupe added a commit to rdoupe/obs-studio that referenced this pull request Oct 22, 2026
The Windows Tier 2 build stops before CTest with LNK2019, unresolved
cm_print_error in check_plan: test_video_output_plan (from obs-rust#1714) calls
fail_msg(), which expands to that private cmocka printer, and the Windows
cmocka does not export it. obs-rust#1580 was the same failure in
test_output_delay_e2e; obs-rust#1591 fixed it with fprintf(stderr, ...) and plain
fail(), and added a check for that one file.

ci/test_cmocka_windows_diagnostics.py generalizes that check. It reads
every add_executable() in test/cmocka/CMakeLists.txt and tests.d/*.cmake,
skips the ones an enclosing if() keeps off Windows (OS_LINUX, UNIX,
NOT WIN32, or a plugin target that plugins/CMakeLists.txt only adds on
other platforms; else() counts as Windows), and fails if any of their
sources calls fail_msg(). Comments that mention fail_msg() do not count.
As in obs-rust#1591, it also compiles the actual diagnostic helpers of
test_video_output_plan (check_plan, techniques_exist_in_the_effect,
size_check_edges, output_size_check_edges) against a model of the
Windows link contract, a cm_print_error declaration with no definition,
and expects each forced failure to print its diagnostic and fail.

On master it fails twice: the scan finds four fail_msg() calls in
test_video_output_plan.c and three in test_settings_track_rows.cpp (a
Qt6::Widgets test that Windows builds), and the probe does not link
(undefined reference to cm_print_error in all four helpers).

Refs obs-rust#1713
rdoupe added a commit to rdoupe/obs-studio that referenced this pull request Oct 22, 2026
…them

The Windows cmocka does not export cm_print_error(), which fail_msg()
expands to there, so a Windows-built test that calls it stops the
Windows Tier 2 build with LNK2019 before CTest runs. obs-rust#1741 converted
three of the four calls in test_video_output_plan; the one in
output_size_check_edges (added by obs-rust#1734) is still there, so the
Windows link still fails. The same pattern as obs-rust#1591 for obs-rust#1580: it is
now fprintf(stderr, ...) with the same format and arguments, a
terminating newline, and then a plain fail(), under the same condition.

test_settings_track_rows (Qt6::Widgets only, so Windows builds it too)
had three such calls. It links on Windows today, but it is the only
other Windows-built test that calls fail_msg(), and the new check holds
every such test to the same rule, so it gets the same change.

Once it links, test_video_output_plan fails on Windows in
techniques_exist_in_the_effect ("technique Planar_Y is not in
format_conversion.effect"): the Windows checkout gives the effect file
CRLF line endings, and the "\ntechnique NAME\n" needles never match
"\r\n". The test now drops the CRs from the text it read before
searching. Converting the effect to CRLF reproduces the failure on
Linux, and the test passes with that file after the change.

No condition, loop, case or assertion changes.

Refs obs-rust#1713
zackees pushed a commit to rdoupe/obs-studio that referenced this pull request Oct 22, 2026
The Windows Tier 2 build stops before CTest with LNK2019, unresolved
cm_print_error in check_plan: test_video_output_plan (from obs-rust#1714) calls
fail_msg(), which expands to that private cmocka printer, and the Windows
cmocka does not export it. obs-rust#1580 was the same failure in
test_output_delay_e2e; obs-rust#1591 fixed it with fprintf(stderr, ...) and plain
fail(), and added a check for that one file.

ci/test_cmocka_windows_diagnostics.py generalizes that check. It reads
every add_executable() in test/cmocka/CMakeLists.txt and tests.d/*.cmake,
skips the ones an enclosing if() keeps off Windows (OS_LINUX, UNIX,
NOT WIN32, or a plugin target that plugins/CMakeLists.txt only adds on
other platforms; else() counts as Windows), and fails if any of their
sources calls fail_msg(). Comments that mention fail_msg() do not count.
As in obs-rust#1591, it also compiles the actual diagnostic helpers of
test_video_output_plan (check_plan, techniques_exist_in_the_effect,
size_check_edges, output_size_check_edges) against a model of the
Windows link contract, a cm_print_error declaration with no definition,
and expects each forced failure to print its diagnostic and fail.

On master it fails twice: the scan finds four fail_msg() calls in
test_video_output_plan.c and three in test_settings_track_rows.cpp (a
Qt6::Widgets test that Windows builds), and the probe does not link
(undefined reference to cm_print_error in all four helpers).

Refs obs-rust#1713
zackees pushed a commit to rdoupe/obs-studio that referenced this pull request Oct 22, 2026
…them

The Windows cmocka does not export cm_print_error(), which fail_msg()
expands to there, so a Windows-built test that calls it stops the
Windows Tier 2 build with LNK2019 before CTest runs. obs-rust#1741 converted
three of the four calls in test_video_output_plan; the one in
output_size_check_edges (added by obs-rust#1734) is still there, so the
Windows link still fails. The same pattern as obs-rust#1591 for obs-rust#1580: it is
now fprintf(stderr, ...) with the same format and arguments, a
terminating newline, and then a plain fail(), under the same condition.

test_settings_track_rows (Qt6::Widgets only, so Windows builds it too)
had three such calls. It links on Windows today, but it is the only
other Windows-built test that calls fail_msg(), and the new check holds
every such test to the same rule, so it gets the same change.

Once it links, test_video_output_plan fails on Windows in
techniques_exist_in_the_effect ("technique Planar_Y is not in
format_conversion.effect"): the Windows checkout gives the effect file
CRLF line endings, and the "\ntechnique NAME\n" needles never match
"\r\n". The test now drops the CRs from the text it read before
searching. Converting the effect to CRLF reproduces the failure on
Linux, and the test passes with that file after the change.

No condition, loop, case or assertion changes.

Refs obs-rust#1713
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 22, 2026
* ci: Catch fail_msg() in cmocka tests that Windows builds

The Windows Tier 2 build stops before CTest with LNK2019, unresolved
cm_print_error in check_plan: test_video_output_plan (from obs-rust#1714) calls
fail_msg(), which expands to that private cmocka printer, and the Windows
cmocka does not export it. obs-rust#1580 was the same failure in
test_output_delay_e2e; obs-rust#1591 fixed it with fprintf(stderr, ...) and plain
fail(), and added a check for that one file.

ci/test_cmocka_windows_diagnostics.py generalizes that check. It reads
every add_executable() in test/cmocka/CMakeLists.txt and tests.d/*.cmake,
skips the ones an enclosing if() keeps off Windows (OS_LINUX, UNIX,
NOT WIN32, or a plugin target that plugins/CMakeLists.txt only adds on
other platforms; else() counts as Windows), and fails if any of their
sources calls fail_msg(). Comments that mention fail_msg() do not count.
As in obs-rust#1591, it also compiles the actual diagnostic helpers of
test_video_output_plan (check_plan, techniques_exist_in_the_effect,
size_check_edges, output_size_check_edges) against a model of the
Windows link contract, a cm_print_error declaration with no definition,
and expects each forced failure to print its diagnostic and fail.

On master it fails twice: the scan finds four fail_msg() calls in
test_video_output_plan.c and three in test_settings_track_rows.cpp (a
Qt6::Widgets test that Windows builds), and the probe does not link
(undefined reference to cm_print_error in all four helpers).

Refs obs-rust#1713

* test: Report track-row failures without fail_msg()

The Windows cmocka does not export cm_print_error(), which fail_msg()
expands to there, so a Windows-built test that calls it stops the
Windows Tier 2 build with LNK2019 before CTest runs (obs-rust#1713: obs-rust#1741,
obs-rust#1745 and obs-rust#1762 fixed test_video_output_plan).

test_settings_track_rows (Qt6::Widgets only, so Windows builds it too)
still had three such calls. It links on Windows today, but it is the
only Windows-built test left that calls fail_msg(), and the new check
holds every such test to the same rule. Each becomes fprintf(stderr,
...) with the same format and arguments and a terminating newline, then
a plain fail(), under the same condition. No condition, loop, case or
assertion changes.

Refs obs-rust#1713
@zackees
zackees deleted the fix/1580-output-delay-cmocka-link branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Windows Tier 2: output delay e2e test fails to link cm_print_error

1 participant