Skip to content

Allow global setup code in tests (before threads spawn)Β #1442

Open
@kamalmarhubi

Description

@kamalmarhubi

I have some setup code that I'd like to run that requires the process be single threaded when it runs. std::sync::Once called at the top of each #[test] isn't enough, as threads have already spawned by that point. My workaround is to use harness = false but I either lose nice reporting or opt into #[feature(test)] and require nightly.

I'm aware of #816, but I'm hoping that a limited improvement might be allowed to the stable interface of the existing test crate... :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-dev-toolsRelevant to the development tools team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions