Allow building helper binaries for tests
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
I've written a few crates that do process manipulation, and when writing tests I find myself needing a helper binary to run and manipulate. Three quick examples are read-process-memory, spawn-ptrace, and spawn-task-port.
I currently just put those helper binaries in src/bin so they get built as programs, but they're not intended for end-user consumption and don't need to be built except for test usage. It would be nicer if cargo had a way to build helper binaries for tests, like perhaps .rs files under tests/bin could be treated as such? Helper binaries should be considered a dependency of running tests, so they should be rebuilt as necessary before tests are run, but could be built in parallel with the tests themselves.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing helper-binary examples in src/bin/test.rs from read-process-memory, spawn-ptrace, and rust-spawn-task-port. Determine how Cargo could discover and build test-only binaries, including rebuilding them before tests and allowing parallel execution; done means this workflow is supported without treating helpers as end-user binaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100