Skip to content

S2: cargo-free test runner (tests/run.sh) replacing cargo test - #38

Merged
dev-dami merged 8 commits into
mainfrom
agent/s2-tests
Nov 22, 2026
Merged

dev-dami merged 8 commits into
mainfrom
agent/s2-tests

Conversation

@dev-dami

@dev-dami dev-dami commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

What

tests/run.sh runs Track's test suite with bash and POSIX tools only: no cargo, no Rust. This is step 2 of retiring the Rust code. S1 (seed bootstrap, #35) is merged; S3 (yard in Track, #36) and S4 (trackc lsp, #37) are open.

tests/run.sh [-j N] [-t SECS] [-k|-K] [-l] [PATTERN...]
  • Suites: tests/sh/{native,selfhost,lifecycle,lang,cli,tools}.sh, 97 tests. Each test runs in its own process under timeout, in an empty scratch directory.
  • Inventory: tests/PORTING.md maps all 165 #[test]s in tests/*.rs.
  • Manifest: tests/sh/ids.txt lists every test. A full run fails if a test is deleted or renamed without updating it.
  • CI: the seed-bootstrap job runs tests/run.sh right after the bootstrap, with PATH=/usr/bin:/bin.

Verification

  • Full run, trackc built from this tree: 97 passed, 0 failed, 92 s. cargo test takes about 133 s.

  • An independent check gave PASS with notes:

    • All 165 Rust tests are in PORTING.md.
    • Side-by-side reading of 10 tests (const_divrem, returns_hidden, temps cells, SIGFPE flush, bootstrap, parity, ASan, life --place) found no dropped assertion.
    • Two clean runs showed no flaky tests.
    • 14 of 15 goldens re-recorded with the Rust stage0 match. The 15th prints dir_exists("src"), so it depends on the working directory.
  • The check found two holes, now fixed in ab724bc:

    • A trackc stub that always exits 0 passed both parity tests, because two missing binaries both exit 127 and "agree". Builds now require an executable, and same_run rejects 126/127.
    • Deleting a test function ran one test fewer and still reported success. It is now reported against ids.txt.
    • Both breaks were re-run and now fail the run.
  • CI found two problems that local runs hid, both fixed:

    • cce529b: the 25 goldens matched *.out in .gitignore. tests/cases/**/*.out is now unignored.
    • dfe256d: the error_handling golden contained this machine's /etc/hostname size. It now holds @HOSTNAME_BYTES@, which the test fills in at run time.
    • A run from a clean clone passes 97/97.

Known weak spots (not fixed here)

  • SIGFPE is checked as exit 136, not as the signal itself.
  • ASan tests count as PASS when the compiler has no ASan (the cargo tests skipped silently too). The 3 nvim tests do the same when nvim is missing.
  • Two lang checks are skipped when /etc/hostname is missing.

Review

CodeRabbit skips this PR: 231 files is over its free limit of 100, and most of them are small golden and case files. The independent check above is the only review it has had.

Next

S5 removes src/, Cargo.toml, tests/*.rs and the cargo CI jobs, once this PR, #36 and #37 are merged.

🤖 Generated with Claude Code

dev-dami and others added 6 commits November 22, 2026 12:56
Port tests/native_tests.rs to tests/sh/native.sh on a bash runner with
per-test timeouts, PASS/FAIL lines and optional parallelism.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selfhost.sh and lifecycle.sh cover every selfhost_tests.rs test (the
stage0 halves of the parity tests become goldens recorded from stage0);
tools.sh ports the editor and headless-highlight asset checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lang.sh and cli.sh hold the trackc halves of integration, cli,
codegen_semantics, regression, soundness, checker, lexer, parser and
performance tests; verdicts pin trackc's exact first diagnostic line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two holes found by the independent check:
- A trackc that exits 0 without writing output passed both parity tests
  (two missing binaries both exit 127 and so "agree"). build() and the
  parity loops now require an executable, and same_run rejects 126/127.
- Deleting or renaming a test function silently ran one test fewer. A full
  run now checks the suites against tests/sh/ids.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 231 files, which is 131 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24a0733c-f599-4d9e-b5c4-123a9db46c1d
Commits

Reviewing files that changed from the base of the PR and between 9c6f813 and dfe256d.

Files ignored due to path filters: 27

  • tests/cases/examples/arithmetic.out is excluded by !**/*.out
  • tests/cases/examples/borrow.out is excluded by !**/*.out
  • tests/cases/examples/error_handling.out is excluded by !**/*.out
  • tests/cases/examples/generics.out is excluded by !**/*.out
  • tests/cases/examples/hello.out is excluded by !**/*.out
  • tests/cases/examples/linear_auto_free.out is excluded by !**/*.out
  • tests/cases/examples/macro_test.out is excluded by !**/*.out
  • tests/cases/examples/net_demo.out is excluded by !**/*.out
  • tests/cases/examples/slice_and_types.out is excluded by !**/*.out
  • tests/cases/examples/stdlib_demo.out is excluded by !**/*.out
  • tests/cases/examples/structs_arrays.out is excluded by !**/*.out
  • tests/cases/examples/union_enum_test.out is excluded by !**/*.out
  • tests/cases/examples/use_test.out is excluded by !**/*.out
  • tests/cases/examples/v030_features_demo.out is excluded by !**/*.out
  • tests/cases/examples/v040_features_demo.out is excluded by !**/*.out
  • tests/cases/lang/parses.tsv is excluded by !**/*.tsv
  • tests/cases/lang/verdicts.tsv is excluded by !**/*.tsv
  • tests/cases/run_outputs/const_forward_reference.out is excluded by !**/*.out
  • tests/cases/run_outputs/match_in_loop_resets_each_time.out is excluded by !**/*.out
  • tests/cases/run_outputs/stack_tuple_destructured_and_matched.out is excluded by !**/*.out
  • tests/cases/run_outputs/stack_tuple_reassigned_from_itself.out is excluded by !**/*.out
  • tests/cases/run_outputs/tuple_copied_out_of_loop_escapes.out is excluded by !**/*.out
  • tests/cases/run_outputs/tuple_in_returned_array.out is excluded by !**/*.out
  • tests/cases/run_outputs/tuple_in_returned_struct.out is excluded by !**/*.out
  • tests/cases/run_outputs/tuple_in_returned_tuple.out is excluded by !**/*.out
  • tests/cases/run_outputs/tuple_in_returned_union.out is excluded by !**/*.out
  • tests/cases/run_outputs/tuple_literal_in_loop.out is excluded by !**/*.out
Files selected for processing: 231

  • .github/workflows/ci.yml
  • .gitignore
  • tests/PORTING.md
  • tests/cases/const_divrem/div_cmp_ok.trk
  • tests/cases/const_divrem/div_cmp_zero.trk
  • tests/cases/const_divrem/div_cmp_zero.want
  • tests/cases/const_divrem/div_min.trk
  • tests/cases/const_divrem/div_min.want
  • tests/cases/const_divrem/div_named_cmp_ok.trk
  • tests/cases/const_divrem/div_named_cmp_zero.trk
  • tests/cases/const_divrem/div_named_cmp_zero.want
  • tests/cases/const_divrem/div_ok.trk
  • tests/cases/const_divrem/div_variant_after_cmp_zero.trk
  • tests/cases/const_divrem/div_variant_after_cmp_zero.want
  • tests/cases/const_divrem/div_variant_named_cmp_ok.trk
  • tests/cases/const_divrem/div_variant_next_ok.trk
  • tests/cases/const_divrem/div_variant_ok.trk
  • tests/cases/const_divrem/div_variant_zero.trk
  • tests/cases/const_divrem/div_variant_zero.want
  • tests/cases/const_divrem/div_zero.trk
  • tests/cases/const_divrem/div_zero.want
  • tests/cases/const_divrem/enum_div_min.trk
  • tests/cases/const_divrem/enum_div_min.want
  • tests/cases/const_divrem/enum_div_zero.trk
  • tests/cases/const_divrem/enum_div_zero.want
  • tests/cases/const_divrem/enum_named_cmp_zero.trk
  • tests/cases/const_divrem/enum_named_cmp_zero.want
  • tests/cases/const_divrem/mod_min.trk
  • tests/cases/const_divrem/mod_min.want
  • tests/cases/const_divrem/mod_named_not_zero.trk
  • tests/cases/const_divrem/mod_named_not_zero.want
  • tests/cases/const_divrem/mod_not_zero.trk
  • tests/cases/const_divrem/mod_not_zero.want
  • tests/cases/const_divrem/mod_zero.trk
  • tests/cases/const_divrem/mod_zero.want
  • tests/cases/examples/arithmetic.code
  • tests/cases/examples/borrow.code
  • tests/cases/examples/error_handling.code
  • tests/cases/examples/generics.code
  • tests/cases/examples/hello.code
  • tests/cases/examples/linear_auto_free.code
  • tests/cases/examples/macro_test.code
  • tests/cases/examples/net_demo.code
  • tests/cases/examples/slice_and_types.code
  • tests/cases/examples/stdlib_demo.code
  • tests/cases/examples/structs_arrays.code
  • tests/cases/examples/union_enum_test.code
  • tests/cases/examples/use_test.code
  • tests/cases/examples/v030_features_demo.code
  • tests/cases/examples/v040_features_demo.code
  • tests/cases/lang/argv.trk
  • tests/cases/lang/constfold.trk
  • tests/cases/lang/consts.trk
  • tests/cases/lang/error_handling.trk
  • tests/cases/lang/for_test.trk
  • tests/cases/lang/gen.trk
  • tests/cases/lang/lex_comments.tokens
  • tests/cases/lang/lex_comments.trk
  • tests/cases/lang/lex_keywords.tokens
  • tests/cases/lang/lex_keywords.trk
  • tests/cases/lang/lex_literals.tokens
  • tests/cases/lang/lex_literals.trk
  • tests/cases/lang/lex_operators.tokens
  • tests/cases/lang/lex_operators.trk
  • tests/cases/lang/lex_types.tokens
  • tests/cases/lang/lex_types.trk
  • tests/cases/lang/lnot.trk
  • tests/cases/lang/logic.trk
  • tests/cases/lang/mem_test.trk
  • tests/cases/lang/pred.trk
  • tests/cases/lang/returns.trk
  • tests/cases/lang/scopes.trk
  • tests/cases/lang/signs.trk
  • tests/cases/lang/strpat.trk
  • tests/cases/lang/structs.trk
  • tests/cases/lang/tuples.trk
  • tests/cases/lang/unions.trk
  • tests/cases/lang/values.trk
  • tests/cases/life_clean/clean0.trk
  • tests/cases/life_clean/clean1.trk
  • tests/cases/life_clean/clean2.trk
  • tests/cases/life_clean/clean3.trk
  • tests/cases/life_clean/clean4.trk
  • tests/cases/life_clean/clean5.trk
  • tests/cases/life_clean/clean6.trk
  • tests/cases/life_clean/clean7.trk
  • tests/cases/life_clean/clean8.trk
  • tests/cases/life_clean/clean9.trk
  • tests/cases/life_errors/00.path
  • tests/cases/life_errors/00.want
  • tests/cases/life_errors/01.path
  • tests/cases/life_errors/01.want
  • tests/cases/life_errors/02.path
  • tests/cases/life_errors/02.want
  • tests/cases/life_errors/03.path
  • tests/cases/life_errors/03.want
  • tests/cases/life_errors/04.path
  • tests/cases/life_errors/04.want
  • tests/cases/life_errors/05.trk
  • tests/cases/life_errors/05.want
  • tests/cases/life_errors/06.trk
  • tests/cases/life_errors/06.want
  • tests/cases/life_errors/07.trk
  • tests/cases/life_errors/07.want
  • tests/cases/life_errors/08.trk
  • tests/cases/life_errors/08.want
  • tests/cases/life_errors/09.trk
  • tests/cases/life_errors/09.want
  • tests/cases/life_errors/10.trk
  • tests/cases/life_errors/10.want
  • tests/cases/life_errors/11.trk
  • tests/cases/life_errors/11.want
  • tests/cases/life_errors/12.trk
  • tests/cases/life_errors/12.want
  • tests/cases/life_errors/13.trk
  • tests/cases/life_errors/13.want
  • tests/cases/life_errors/14.trk
  • tests/cases/life_errors/14.want
  • tests/cases/life_errors/15.trk
  • tests/cases/life_errors/15.want
  • tests/cases/life_errors/16.trk
  • tests/cases/life_errors/16.want
  • tests/cases/life_errors/17.trk
  • tests/cases/life_errors/17.want
  • tests/cases/life_errors/18.trk
  • tests/cases/life_errors/18.want
  • tests/cases/life_warn_clean/clean0.trk
  • tests/cases/life_warn_clean/clean1.trk
  • tests/cases/life_warn_clean/clean2.trk
  • tests/cases/life_warn_clean/clean3.trk
  • tests/cases/life_warn_clean/clean4.trk
  • tests/cases/life_warn_clean/clean5.trk
  • tests/cases/run_outputs/const_forward_reference.trk
  • tests/cases/run_outputs/match_in_loop_resets_each_time.trk
  • tests/cases/run_outputs/stack_tuple_destructured_and_matched.trk
  • tests/cases/run_outputs/stack_tuple_reassigned_from_itself.trk
  • tests/cases/run_outputs/tuple_copied_out_of_loop_escapes.trk
  • tests/cases/run_outputs/tuple_in_returned_array.trk
  • tests/cases/run_outputs/tuple_in_returned_struct.trk
  • tests/cases/run_outputs/tuple_in_returned_tuple.trk
  • tests/cases/run_outputs/tuple_in_returned_union.trk
  • tests/cases/run_outputs/tuple_literal_in_loop.trk
  • tests/cases/trackc_verdicts/accept/aborting_branch_skips_merge.trk
  • tests/cases/trackc_verdicts/accept/generic_dup_of_copy_type.trk
  • tests/cases/trackc_verdicts/accept/generic_max_of_copy_type.trk
  • tests/cases/trackc_verdicts/accept/generic_max_of_linear_type.trk
  • tests/cases/trackc_verdicts/accept/generic_nested_instantiation_copy.trk
  • tests/cases/trackc_verdicts/accept/generic_param_used_once.trk
  • tests/cases/trackc_verdicts/accept/generic_pick_with_early_return.trk
  • tests/cases/trackc_verdicts/accept/generic_twice_of_copy_type.trk
  • tests/cases/trackc_verdicts/accept/guard_read_only_then_use.trk
  • tests/cases/trackc_verdicts/accept/guard_spend_disjoint_enum_variant.trk
  • tests/cases/trackc_verdicts/accept/guard_spend_irrefutable_always_spent.trk
  • tests/cases/trackc_verdicts/accept/guard_spend_skips_disjoint_literal_arm.trk
  • tests/cases/trackc_verdicts/accept/guard_two_spends_disjoint_arms.trk
  • tests/cases/trackc_verdicts/accept/returning_branch_in_loop.trk
  • tests/cases/trackc_verdicts/accept/returning_else_branch_skips_merge.trk
  • tests/cases/trackc_verdicts/accept/returning_match_arm_skips_merge.trk
  • tests/cases/trackc_verdicts/accept/returning_then_branch_skips_merge.trk
  • tests/cases/trackc_verdicts/accept/right_struct_ref.trk
  • tests/cases/trackc_verdicts/reject/arity_builtin.trk
  • tests/cases/trackc_verdicts/reject/arity_too_few.trk
  • tests/cases/trackc_verdicts/reject/arity_too_many.trk
  • tests/cases/trackc_verdicts/reject/const_cycle.trk
  • tests/cases/trackc_verdicts/reject/const_div_by_zero.trk
  • tests/cases/trackc_verdicts/reject/const_mod_by_zero.trk
  • tests/cases/trackc_verdicts/reject/const_not_constant.trk
  • tests/cases/trackc_verdicts/reject/consume_in_match_arm.trk
  • tests/cases/trackc_verdicts/reject/consume_in_while_cond.trk
  • tests/cases/trackc_verdicts/reject/destructure_int.trk
  • tests/cases/trackc_verdicts/reject/destructure_too_many.trk
  • tests/cases/trackc_verdicts/reject/generic_both_instantiations_checked.trk
  • tests/cases/trackc_verdicts/reject/generic_nested_instantiation_linear.trk
  • tests/cases/trackc_verdicts/reject/generic_param_is_linear.trk
  • tests/cases/trackc_verdicts/reject/generic_twice_of_linear_type.trk
  • tests/cases/trackc_verdicts/reject/guard_consumes_on_diverging_arm.trk
  • tests/cases/trackc_verdicts/reject/guard_spend_binding_then_use.trk
  • tests/cases/trackc_verdicts/reject/guard_spend_inconsistent_after_match.trk
  • tests/cases/trackc_verdicts/reject/guard_spend_irrefutable_use_after.trk
  • tests/cases/trackc_verdicts/reject/guard_spend_same_enum_variant.trk
  • tests/cases/trackc_verdicts/reject/guard_spend_wild_arm_use_after_free.trk
  • tests/cases/trackc_verdicts/reject/guard_two_spends_wild_uses_one.trk
  • tests/cases/trackc_verdicts/reject/index_on_int.trk
  • tests/cases/trackc_verdicts/reject/returning_else_keeps_then_state.trk
  • tests/cases/trackc_verdicts/reject/shadow_in_else_hides_consume.trk
  • tests/cases/trackc_verdicts/reject/tuple_index_on_int.trk
  • tests/cases/trackc_verdicts/reject/unused_generic_checked_linear.trk
  • tests/cases/trackc_verdicts/reject/wrong_struct_ref.trk
  • tests/cases/verdicts/accept/array_index_update.trk
  • tests/cases/verdicts/accept/borrow_does_not_move.trk
  • tests/cases/verdicts/accept/consistent_if.trk
  • tests/cases/verdicts/accept/const_before_use.trk
  • tests/cases/verdicts/accept/copy_ints.trk
  • tests/cases/verdicts/accept/lens_field_update.trk
  • tests/cases/verdicts/accept/mutable_assign.trk
  • tests/cases/verdicts/accept/reassign_after_move_in_loop.trk
  • tests/cases/verdicts/accept/return_param_ref.trk
  • tests/cases/verdicts/accept/struct_field_update.trk
  • tests/cases/verdicts/reject/array_moved_by_value.trk
  • tests/cases/verdicts/reject/assign_undeclared.trk
  • tests/cases/verdicts/reject/compile_error_macro.trk
  • tests/cases/verdicts/reject/consume_in_loop.trk
  • tests/cases/verdicts/reject/forbidden_free.trk
  • tests/cases/verdicts/reject/frozen_by_reference.trk
  • tests/cases/verdicts/reject/global_const_spent_in_branch.trk
  • tests/cases/verdicts/reject/if_inside_loop_consumes.trk
  • tests/cases/verdicts/reject/immutable_assign.trk
  • tests/cases/verdicts/reject/immutable_field_update.trk
  • tests/cases/verdicts/reject/inconsistent_if.trk
  • tests/cases/verdicts/reject/lens_cannot_escape.trk
  • tests/cases/verdicts/reject/lens_locks_target.trk
  • tests/cases/verdicts/reject/move_then_use.trk
  • tests/cases/verdicts/reject/mut_does_not_leak_across_functions.trk
  • tests/cases/verdicts/reject/nested_if_second_resource.trk
  • tests/cases/verdicts/reject/return_local_ref.trk
  • tests/cases/verdicts/reject/shadow_in_then_keeps_outer.trk
  • tests/cases/verdicts/reject/shadowed_binding_is_immutable.trk
  • tests/cases/verdicts/reject/tuple_index_bounds.trk
  • tests/cases/verdicts/reject/typo_suggestion.trk
  • tests/cases/verdicts/reject/undeclared_use.trk
  • tests/cases/verdicts/reject/unknown_field_access.trk
  • tests/cases/verdicts/reject/unknown_struct_field.trk
  • tests/run.sh
  • tests/sh/cli.sh
  • tests/sh/ids.txt
  • tests/sh/lang.sh
  • tests/sh/lib.sh
  • tests/sh/lifecycle.sh
  • tests/sh/native.sh
  • tests/sh/selfhost.sh
  • tests/sh/tools.sh

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

dev-dami and others added 2 commits November 22, 2026 13:30
CI failed with 'no golden tests/cases/examples/arithmetic.out': the 25
goldens the parity tests read were on disk locally but matched *.out in
.gitignore. Unignore tests/cases/**/*.out and add them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…name size

The example prints the size of /etc/hostname (14 here, 11 on the CI runner).
The golden now holds @HOSTNAME_BYTES@ and the test fills in the local size
(0 when the file is missing, the example's fallback path).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dev-dami
dev-dami merged commit 8f3ea45 into main Nov 22, 2026
6 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.

1 participant