Skip to content

test: Drop the last fail_msg from test_video_output_plan (Windows link) - #1745

Merged
zackees merged 2 commits into
masterfrom
fix/video-output-plan-fail-msg-2
Oct 22, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/video-output-plan-fail-msg-2

Conversation

@zackees

@zackees zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member

Follow-up to #1741. #1734 added output_size_check_edges with another fail_msg(), so master still doesn't link this test on Windows:

test_video_output_plan.obj : error LNK2019: unresolved external symbol cm_print_error referenced in function output_size_check_edges

RED evidence: run 39736959822, job 119685803983 (Windows Tier 2 on #1727, rebased on master after #1741).

GREEN: the call reports through fprintf(stderr, …) followed by fail(), as the rest of the file now does. The assertion is unchanged. This was the only fail_msg( left in the file.

@rdoupe

rdoupe commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Heads-up: once this links, Windows Tier 2 will fail techniques_exist_in_the_effect ("technique Planar_Y is not in format_conversion.effect"). The Windows checkout gives the effect CRLF line endings, so the "\ntechnique NAME\n" needles never match. Seen on #1743's ci-full run (job 119687209809). #1743 now carries the same fail_msg line as this PR plus the CR stripping for that check, so either land #1743 alone, or land this and #1743 rebases down to the CRLF fix and the CI guard.

@zackees
zackees added this pull request to the merge queue Oct 22, 2026
Merged via the queue into master with commit d71d985 Oct 22, 2026
25 checks passed
rdoupe added a commit to rdoupe/obs-studio that referenced this pull request Oct 22, 2026
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
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/video-output-plan-fail-msg-2 branch October 26, 2026 15:44
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.

2 participants