Skip to content

Allow building helper binaries for tests #4356

Open
@luser

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.

Metadata

Assignees

No one assigned

    Labels

    A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)C-enhancementCategory: enhancementCommand-testS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions