Skip to content

Expand trybuild-like for tests missing in cargo metadata #69

Open
@Robbepop

Description

@Robbepop

Original idea: dtolnay/trybuild#35
Suggested approach: dtolnay/trybuild#35 (comment)

Solution Summary

cargo expand should be able to expand the code of a test file somename.rs in the tests directory of a given crate via --test somename even though somename.rs exists but "somename" is not part of the test targets listed for the given crate by cargo-metadata.

Technical Details

The expansion should be done in a similar way as the trybuild crate handles building and testing of its tests:

  • pull out the code under test (e.g. our somename.rs) into a temp. directory
  • run rustc against that
    • just like trybuild would
    • using --pretty=expanded instead of building or testing anything

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions