Ah, sorry, I want to run the test manually, but because only the zig files are known to the build system it doesn’t know anything has changed, so just reiterates the cached result.
entr might be useful later though, so thanks for that.
I don’t think there’s an out-of-the-box way to make build system walk×tamp the files at the configure time, so that the tests are re-run only when a file changed. You could do that by writing a custom step, but that requires a fair amount of code.
Consider if you could @embedFile in the tests? That would mean that you’d have to repeat the name of each file twice, but then you’ll get precise incremental tracking for free
where MyCustomCheckFileFreshnessStep is the code you write. Which code specifcally is tricky, as the build system is not super well documented. But looking at zig/lib/std/Build/Step/InstallDir.zig at master · ziglang/zig · GitHub should be a good start, it implements similar file-system walking logic.
So, in this sense, I don’t think there’s necessary needing to change anything on the Zig side here.
There could be a feature to have this as a built-in step, but this does feel somewhat niche to be honest, and perhaps at the moment left better to the ecosystem to experiment around.
I have not tested this, but there is std.Build.Step.Run.addFileInput which appears to let you add additional files that the run step should check when determining whether any of its inputs has changes. In theory, you might be able to do something like this