Skip to content

[IMPROVEMENT] Test command line options through ccxr_parse_parameters into C - #2409

Open
Deepak-negi11 wants to merge 1 commit into
CCExtractor:masterfrom
Deepak-negi11:test/cli-through-c
Open

Deepak-negi11 wants to merge 1 commit into
CCExtractor:masterfrom
Deepak-negi11:test/cli-through-c

Conversation

@Deepak-negi11

@Deepak-negi11 Deepak-negi11 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

In raising this pull request, I confirm the following (please check boxes):

Reason for this PR:

  • This PR adds new functionality.
  • This PR fixes a bug that I have personally experienced or that a real user has reported and for which a sample exists.
  • This PR is porting code from C to Rust.

Sanity check:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • If the PR adds new functionality, I've added it to the changelog. If it's just a bug fix, I have NOT added it to the changelog.
  • I am NOT adding new C code unless it's to fix an existing, reproducible bug.

Repro instructions:

cd src/rust && cargo test --lib cli_tests

To see what the new tests catch, make one of these changes and run both test sets:

Change Other tests (437) New tests
Stop copying --ucla to C (common.rs) all pass test_ucla_reaches_c fails
Stop copying --no-fontcolor to C all pass test_no_font_color_reaches_c fails
Stop copying --gui-mode-reports to C all pass test_gui_mode_reports_reaches_c fails

Part of #2408 (first step).

Problem

The parser tests check the Rust settings right after parsing. They never run the real entry point that converts old spellings, and they never look at what C receives. So bugs in those two places pass every test, like the ones fixed in #2367, #2370 and #2397.

What this adds

src/rust/src/cli_tests.rs:

  • A helper that runs options through ccxr_parse_parameters, the same function main() calls, and returns copies of the ccx_options and tlt_config that C reads. (In cargo test no C code runs, so the tests check what copy_from_rust writes for C.) It holds a lock because those are global.
  • Every parse starts from zeroed options, so one test can't see values left by another.
  • 12 tests checking the C values for new and old spellings: --delay, --out, --ucla, --608, --no-fontcolor, --gui-mode-reports, --startat, --sentencecap, --mkvlang, --tpage, plus an unknown option being rejected.

Next steps (separate PRs): a test that fails when an option has no test, then tests for the options that have none yet.

Testing

  • cargo test (437 passed), cargo fmt --check, cargo clippy -- -D warnings.
  • New tests run 5 times in a row with no failures, so the lock prevents conflicts between parallel tests.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 19:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Deepak-negi11 Deepak-negi11 changed the title [IMPROVEMENT] Test command line options through ccxr_parse_parameters… [IMPROVEMENT] Test command line options through ccxr_parse_parameters into C Oct 24, 2026
@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on windows. 171/237 tests matched the approved output:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 0/7
DVD 3/3
DVR-MS 2/2
General 25/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 69/86
Teletext 0/21
WTV 12/13
XDS 32/34

66 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.


Compared with the tip of master — test 9693, commit af4b28d:

  • 0 pass there and fail here
  • 157 fail there and pass here
  • 42 fail on both, with different output
  • 24 fail on both, byte for byte the same

Fail on both but produce different output — behaviour moved even though the verdict did not:

Fail there, pass here:


Compared with the commit this branch was cut from: the same run as the tip of master (test 9693), so the comparison above already covers it.


This branch changes the behaviour of 42 test(s) relative to the tip of master. Those are the ones worth looking at; anything else in the list fails the same way on both sides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants