Skip to content

[IMPROVEMENT] Add tests for the input and output format options - #2411

Open
Deepak-negi11 wants to merge 3 commits into
CCExtractor:masterfrom
Deepak-negi11:test/cli-format-options
Open

Deepak-negi11 wants to merge 3 commits into
CCExtractor:masterfrom
Deepak-negi11:test/cli-format-options

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

Example of what the new tests catch: turn --srt off (change if args.srt to if false where set_output_format is called in parser.rs). The other 442 tests pass; test_output_format_options_reach_c fails. SRT is also the default, so the test checks write_format_rewritten too.

Part of #2408 (step 3). Depends on #2409 and #2410.

Problem

15 options had no test that passes them on the command line: the input format flags and several output options.

What this adds

Tests that check the C settings for both the new (--ts) and old (-ts) spelling:

  • Input formats: --es, --ts, --ps, --asf, --dvr-ms, --wtv, --mp4, --mkv set the C demuxer mode (demux_cfg.auto_stream).
  • Output: --srt, --sami, --dvdraw, --mcc, --null set write_format; --null-terminated sets frame_terminator_0; --report-format JSON sets report_format to json.

These 15 are removed from UNTESTED_OPTIONS, which goes from 24 to 10.

Testing

  • cargo test (442 passed), cargo fmt --check, cargo clippy -- -D warnings.

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

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 force-pushed the test/cli-format-options branch from 96856e2 to 00bdb69 Compare October 24, 2026 23:04
@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