Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a test per file in a directory #78

Open
casey opened this issue Dec 29, 2021 · 4 comments
Open

Generate a test per file in a directory #78

casey opened this issue Dec 29, 2021 · 4 comments
Labels
enhancement New feature or request spike Need to research topic more to come up with a solution

Comments

@casey
Copy link

casey commented Dec 29, 2021

Is it possible to generate a test-case per file in a directory? I'm working on an image generating program, and we have test images and it would be convenient to be able to say something like:

#[test_resources("images/*")]
fn image_test(path: &Path) {
  // image test code
}

This is possible with test-generator but it's less actively maintained.

@luke-biel
Copy link
Collaborator

This behavior is unfortunately not supported in test_case.
Initial idea for this crate was to make everything explicit so that onlooker can understand how function behaves from get-go - other options were not as important.

That being said, we've considered adding "iterables" at some point. No concrete design though. At this moment all I can say is that this is not planned for initial 2.0 release but I'm gonna add it to roadmap.

@luke-biel luke-biel mentioned this issue Jan 2, 2022
7 tasks
@luke-biel luke-biel added enhancement New feature or request spike Need to research topic more to come up with a solution labels Jan 28, 2022
@sazzer
Copy link

sazzer commented Mar 19, 2022

This would be really useful. Right now I'm using glob! from Insta which works great, but doesn't generate a new test for each file. That means that if one file fails then the single test method fails and it's not obvious which is the reason.

@luke-biel
Copy link
Collaborator

Currently blocked - https://users.rust-lang.org/t/recompiling-rust-code-based-on-externally-referenced-files/76526

@nathan-at-least
Copy link

Related: #89 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request spike Need to research topic more to come up with a solution
Projects
None yet
Development

No branches or pull requests

4 participants