Open GeeWee opened 1 year ago
Sorry, isn't possible to handle this without introducing a build.rs
script :cry:
In this script we should define the folder that we want to handle and add a variable that should reflect the last state like an hash (but may there is already something about that in some crates).
That's really sad....
Yes I also couldn't quite figure it out how to do it in a sensible way without a build.rs
script either :(
Might be worth documenting this though, as it took me a little while to figure out the behaviour.
It does look like something nightly-only exists which might be stabilized at some point, not sure if we can do much except wait for that.
Yes... but maybe is not enough because you can track files but not folder.
Seems like it does allow for folder tracking, but it might not support globbing, which is unfortunate.
In #256 I wrote some notes about how to handle this in the most of the cases. Intended, with the use of build.rs
script.
I have a large project with many files that I read as integration tests.
I saw the new #[files] feature and love it.
However, I would expect it to automatically pick up when I add new files to a directory that matches the glob pattern. This does currently seem to happen. If I add a file and run the (already compiled) crate, I do not get the new test case. However if I go in and force the crate to recompile by changing some arbitrary line of code, then the new test case seems to run.
I should probably mention here that my test files are outside the
src
directory, in a separatetests
directory. I'm unsure if cargo picks up on the changed files automatically if they are all insidesrc
My current workaround is just to call
touch src/lib.rs
before running the tests, as that seems to force cargo to recompile.