Repository navigation
Fresh estates: extract GNU Autotest (.at) COBOL test programs and their expected output (#3806) - #3960
Merged
Conversation
…ted output tests/tools/at_extract.py turns an Autotest suite into one directory per test case: the AT_DATA files as raw bytes, and expected.json with the ordered AT_DATA / AT_CHECK steps (command, expected exit status, stdout, stderr), AT_SKIP_IF / AT_XFAIL_IF and keywords. The .at is read the way m4 and autom4te read it: byte by byte, so Shift-JIS is never decoded to parse it. That means quote stripping at collection and at the rescan, comments, dnl, m4_include, trailing blanks dropped before the quadrigraphs. Each case's encoding is verified strictly through source_text; a case that fails is reported, and nothing is replaced. On opensourcecobol4j (i18n_sjis, i18n_utf8, cobol_utf8, jp-compat: 487 cases), every file, command and expected output matches the testsuite that Autoconf 2.71's autom4te generates from the same sources. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TmgE1CwLgaqxqKEgQn5Dw5
Contributor
2 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3806 (epic #3803): the first fresh estate is opensourcecobol4j, a Japanese COBOL-to-Java translator (GPL-3.0). Its GNU Autotest suites hold hundreds of small COBOL programs, each with the expected output its maintainers pinned and CI checks. This PR adds only the extractor. The extracted estate stays outside the repo because of the licence.
tests/tools/at_extract.pyIt writes one directory per test case:
AT_DATAfiles, raw bytes;expected.json: the ordered steps (each AT_DATA file; each AT_CHECK command with its expected exit status, stdout and stderr, whereignore/expout... are modes; AT_SKIP_IF / AT_XFAIL_IF), the keywords, the encoding;suite.jsonwith the provenance.The
.atis read the way m4 and autom4te read it, byte by byte, so a Shift-JIS suite is never decoded in order to parse it:[[x]]becomes[x], as autom4te writes it);#comments anddnlare handled;m4_includeis followed through-I;@&t@keeps them. This was found on the estate:cobol_utf8relies on it.The encoding is verified, not assumed. Each case's files and expected strings must decode strictly in the declared encoding through
gitgalaxy.core.source_text. A case that fails is reported asencoding_error, and nothing is replaced.Verified against autom4te itself
On opensourcecobol4j
developa4cb106, I extracted i18n_sjis (110 cases), i18n_utf8 (127), cobol_utf8 (127) and jp-compat (123). Every AT_DATA file byte, every command, status and exact stdout / stderr matches thetestsuitescript GNU Autoconf 2.71'sautom4te --language=autotestgenerates from the same sources: 487 cases, 0 discrepancies. The cross-check script lives beside the estate and is not in this PR.Tests
tests/tools/test_at_extract.pyruns on a synthetic suite. It covers m4_include, dnl and#comments, nested quotes, quadrigraphs,@&t@and trailing blanks, two programs in one case, the same file written twice (v2/), a negative compile with expected stderr,ignoremodes, and Shift-JIS bytes whose trail byte is\(kept raw and verified). A wrong declared encoding is reported, not replaced.python tests/tools/pr_gates.py --fast: 5/5 pass.Not in this PR (by design)
eligibility.json/eligibility.mdand the GnuCOBOL oracle comparison live in/nvme-data/gitgalaxy-data/fresh-estates/opensourcecobol4j/(GPL). Declared: 59 eligible, 131 oracle-mismatch (GnuCOBOL disagrees with opensourcecobol4j's CI-verified output), 297 out of scope with reasons.trial start(Fresh-estate trials: trial record, trial start / report, attempts-to-proof histogram #3805).🤖 Generated with Claude Code
https://claude.ai/code/session_01TmgE1CwLgaqxqKEgQn5Dw5