Skip to content

Add embed files to #[files] #295

@lucascool12

Description

@lucascool12

Currently the #[files] for #[rstest] creates a test for each file and gives the path to each file as a PathBuf. It would be nice to have an option to instead embed the files in the resulting test binary instead of having to read them from the given path. If the files contain a directory it would probably be fine to report an error.

So something along these lines:

#[rstest]
fn test(#[files("tests/*.json)] #[embed] json_file: &str) {
    todo!()
}

We could implement this using include_str!.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions