Repository navigation
test: parameterize bind.bats/cwd.bats by binary - #452
Merged
Merged
Conversation
Implements item 4 of doc/testing-framework-proposal.rst: let the same Bats file run as a conformance check against both proot and proot-rs, with $PROOT pointing at either implementation. The two CLI dialects agree on everything these tests exercise (-b/-r/-w, a positional command) except one thing: proot-rs's clap-based parser needs a literal "--" before the traced command, or it tries to parse the command's own flags (like /bin/sh's -c) as its own. This implementation's getopt-style parser rejects that separator outright. Rather than hand-translating each dialect, test bodies now always write "--" before the command, and the proot() wrapper strips it unless PROOT_IMPL=proot-rs. Verified in Docker: the same bind.bats/cwd.bats pass unmodified against both a native proot build (PROOT=src/proot) and a proot-rs debug build (PROOT=.../proot-rs/target/debug/proot-rs PROOT_IMPL=proot-rs), and the existing auxv.bats/readlink.bats/no-new-privs.bats - which never use "--" - are unaffected, since the wrapper only strips the separator when present. Claude-Session: https://claude.ai/code/session_016jPQ9wt6qox2XEbE71wwCW
|
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.



Summary
doc/testing-framework-proposal.rst: the same Bats file runs as a conformance check against bothprootandproot-rs, with$PROOTpointing at either implementation.bind.bats/cwd.batsexercise (-b/-r/-w, a positional command) except one thing: proot-rs'sclap-based parser needs a literal--before the traced command, or it tries to parse the command's own flags (like/bin/sh's-c) as its own. This implementation's getopt-style parser rejects that separator outright rather than treating it as a no-op.--before the traced command (matching proot-rs's own existing convention), and theproot()helper wrapper strips it unlessPROOT_IMPL=proot-rsis set.auxv.bats/readlink.bats/no-new-privs.bats, which never use--, are unaffected, since the wrapper only strips the separator when present.Test plan
bind.bats/cwd.bats(6 tests) pass unmodified against a nativeprootbuild (PROOT=src/proot)proot-rsdebug build (PROOT=.../proot-rs/target/debug/proot-rs PROOT_IMPL=proot-rs) - genuine cross-implementation conformance, not just independent passesbind.bats cwd.bats auxv.bats readlink.bats no-new-privs.bats, 14 tests) still passes againstprootwith the updated helpershellcheckclean on all three changed files