Skip to content

Need way to run some code before any of unit tests #35762

Closed
@Dushistov

Description

@Dushistov

The details can be found logging while running cargo test.

The problem is in usage of rust log library,
to get it work you need call "initialization" code that provide implementation of log::Log trait
to logging macros.

So to get output from your code that tested by "cargo test" you need somehow call "logging_init" function, but as can I see at now there is no way to tell "cargo" run something before any tests.

Previously reported as cargo bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtestArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions