Skip to content

--format=json might need to generate more info #115971

Open
@ShuiRuTian

Description

@ShuiRuTian

Problem

In some cases, we could not know which package the test belongs to.

Like

    Finished test [optimized + debuginfo] target(s) in 0.08s
     Running unittests src\lib.rs (target\debug\deps\regex_automata-f9e1a19184899f86.exe) // <-- good, it's from regex-automata
...
     Running unittests src\lib.rs (target\debug\deps\regex_lite-0cc4b285a45dbfa1.exe) // <-- good, it's from regex-lite
...
     Running tests/lib.rs (target\debug\deps\integration-d60a2e8ec89aaeb3.exe) // <-- oh no, it's from regex-lite or regex-automata?
...
     Running tests/lib.rs (target\debug\deps\integration-67b4427e13c6296c.exe) // <-- oh no,, it's from regex-lite or regex-automata?
...

In this example, when running for unit tests, we could know the package name.

However, when running for integration tests, we have no idea which integration test is running.

Proposed Solution

For the output event:
{ "type": "suite", "event": "started", "test_count": 3 }

Maybe we could add some more meta info, like
{ "type": "suite", "event": "started", "test_count": 3, package_name: "xxxx" }

Is this possible?

Or we need to change rustc?

Notes

No response

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-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions