Skip to content

Count round-trip results and return a reliable failure status - #666

Merged
jgm merged 1 commit into
commonmark:masterfrom
i1rr:super-hero/cmark-roundtrip-status
Nov 25, 2026
Merged

jgm merged 1 commit into
commonmark:masterfrom
i1rr:super-hero/cmark-roundtrip-status

Conversation

@i1rr

@i1rr i1rr commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

The round-trip driver still expects do_test() to mutate its counter dictionary, but the comparator now returns a status, so mismatches can print while the process exits zero. Count the returned statuses and exit with a boolean failure result, avoiding another false zero at 256 failures on POSIX. Add four real-library subprocess controls to CTest for success, mismatch, mixed results and the 256-failure boundary.

Verification on Linux with Python 3.12.3 and GCC 13.3:

  • The four new controls have three failures on original source; a count-only draft still fails the 256-case control; the final four pass.
  • Shared Debug: all ten CTest entries and 564 API assertions pass. Static Debug: all five CTest entries and 564 assertions pass.
  • The corrected real driver passes all 652 spec roundtrips. Static-program controls return 0/1/1/1 for matching, mismatch, mixed and 256 mismatches.
  • Complete-file apply/reverse/reapply passes with zero fuzz; existing Git modes are retained, including test/CMakeLists.txt at 100755.

Commands: cmake -S . -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DSPEC_TESTS=ON, cmake --build build, ctest --test-dir build --output-on-failure.

Other Python/platform versions, Clang/lint/sanitizers and real use were not tested; conversion-error status was not separately forced. Prepared with OpenAI Codex assistance.

@jgm
jgm merged commit f86f354 into commonmark:master Nov 25, 2026
15 checks passed
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.

2 participants