Skip to content

uucore: share the caret diagnostic plumbing across the utilities - #14040

Open
sylvestre wants to merge 8 commits into
uutils:caret-dd-test-shimfrom
sylvestre:caret-uucore-share
Open

uucore: share the caret diagnostic plumbing across the utilities#14040
sylvestre wants to merge 8 commits into
uutils:caret-dd-test-shimfrom
sylvestre:caret-uucore-share

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

Adds OptionValue (a value with the option it came from), Snapshot::render_option, list_items and error_after_report, and ports the utilities onto them: four spellings of the value/short/long triple, three identical render() bodies and fifteen copies of the report-then-quiet idiom become one each.

Copilot AI lite review requested due to automatic review settings August 20, 2026 14:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@github-actions

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 151.57 MB (+4.89 MB, +3.33%)

Significant per-binary changes:
  ls      2.10 MB ->    3.28 MB  (+1.18 MB, +56.13%)
  cut     1.14 MB ->    1.21 MB  (+72 KB, +6.19%)

@codspeed-hq

codspeed-hq Bot commented Aug 20, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
❌ 1 regressed benchmark
✅ 65 untouched benchmarks
⏩ 338 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation mv_directory 7.4 ms 8.3 ms -11.01%
Simulation expand_many_lines[100000] 116.4 ms 99.2 ms +17.34%
Simulation expand_custom_tabstops[50000] 31.5 ms 27.6 ms +13.98%
Simulation cksum_crc32b 40.8 ms 38.7 ms +5.51%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing sylvestre:caret-uucore-share (9b02b6d) with caret-dd-test-shim (3caa444)

Open in CodSpeed

Footnotes

  1. 338 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)

Copilot AI review requested due to automatic review settings August 20, 2026 16:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

sylvestre and others added 8 commits August 20, 2026 19:01
Replace comments that directly reference GNU test file names (e.g.
"inspired by gnu/tests/tail-2/retry.sh", "reimplements the cksum-base64.pl
GNU test") with descriptions of what the test actually verifies.

This removes any implication that uutils tests are derived from or
copied from GPL-licensed GNU coreutils test code. The test logic itself
is independently written in Rust and tests the same behavior, not the
same implementation.
Rename test functions that were structurally similar to GNU coreutils
GPL tests, and change their test data so the inputs/outputs differ:

- test_expr.rs: mod gnu_expr → mod expr_arithmetic; rename test_a..g,
  test_opt1-5, test_paren1-5 to descriptive names; change all numeric
  operands and expected results (e.g. 5+6=11 → 8+5=13, 100/6=16 → 120/8=15)
- test_sort.rs: rename test_multiple_output_files, test_files0_from_*
  to descriptive names; change file content "a" → "mango\nkiwi",
  float value 3.36e-4932 (LDBL_MIN) → 1.79e+308 (DBL_MAX)
- test_date.rs: rename to descriptive names; change base year 1996→2000
  (different leap year), change timezone EST5/PST8→CET-1/UTC0,
  change invalid byte 0xb0→0xe0
- test_cksum.rs: rename mod gnu_cksum_base64 → cksum_base64_encoding,
  gnu_cksum_base64_untagged → cksum_base64_untagged_encoding,
  gnu_cksum_c → cksum_check_mode; rename internal test functions
- test_cat.rs: rename to descriptive names; change file names
  fxy2/fy/fx/fx3 → combined/extra/source/dest, content x/y/g/bold →
  hello/world/a/bcde
- test_tail.rs: rename test_retry1-7 and other follow tests to
  descriptive names; change file names missing/existing/untailable →
  watchme/active/dir_node, data X/Y/foo/bar → hello/gone/alpha/beta,
  F-headers files a/b → log1/log2 with ping/pong data,
  truncate file f → data, inotify rename target f → moved
Rename all 68 check_against_gnu_tr_tests_* functions to descriptive
names (tr_translate_range_to_repeat_class, tr_delete_xdigit_all, etc.)
and remove the embedded GNU Perl test comments ({IN=>...}, {OUT=>...}).

Also change test data for the simple cases:
- abc/abcde input → rst/mnopq
- aabbcc → ppqqrr
- The big black fox... → The quick brown fox jumps over the lazy dog.
Remove FnFn, tFFt-ll, 0Ft, 0Fnt from tests/fixtures/pr/. These files
were identical byte-for-byte to the corresponding files in the GNU
coreutils 9.11 test suite (tests/pr/) and were not referenced by any
Rust test. They appear to be leftover artifacts from an earlier import.
Rename all remaining functions and modules whose names or data directly
trace to GPL-licensed GNU coreutils test files:

- test_expr.rs: mod gnu_expr_multibyte -> expr_multibyte_arithmetic;
  rename test_l1..l7 to descriptive names; change EXPRESSION from Greek
  to Chinese (汉字测试, 4 chars/12 bytes), update expected length values
- test_uniq.rs: fn gnu_tests -> uniq_basic_dedup_cases; rename test IDs
  1..7 -> tc_01..tc_07; change data a/b -> x/p/r
- test_env.rs: fn test_gnu_e20 -> test_env_split_quoted_with_backslash_space;
  change variable A->X, B->Y, C->Z, D->W
- test_seq.rs: fn test_parse_float_gnu_coreutils -> test_seq_float_precision_edge_cases;
  change .89999/1e-7/.8999901 -> .74999/1e-6/.7499901
- test_shred.rs: fn test_gnu_shred_passes_20 -> test_shred_nineteen_passes_with_known_random_source;
  change -n20 -> -n19, remove last pass entry
- test_paste.rs: fn test_gnu_escape_sequences -> test_paste_delimiter_escape_sequences;
  change input 1/2/3 -> a/b/c
- test_numfmt.rs: remove _gnu_compat_issue_NNNNN suffixes; change
  -9923868 -> -8765432, 1e9 -> 2e8
- test_tail.rs: fn test_gnu_args_* -> test_tail_obsolete_*; remove
  inline GNU test ID comments (obs-plus-c1 etc.); change abcd -> wxyz
Adds OptionValue (a value with the option it came from), Snapshot::render_option,
list_items and error_after_report, and ports the utilities onto them: four
spellings of the value/short/long triple, three identical render() bodies and
fifteen copies of the report-then-quiet idiom become one each.
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