I have written a library which parses and outputs data in a specific format to file.
Currently I produce by test code from an external tool which is an existing implementation of this file format but in Java. My Rust code parses this, round trips it and so forth. I would also like to try reparsing the code with the Java library as a test.
As I do not want people using my library to be dependent on the java library, I generate the test input files out and put the generated files into the git repository. Similarly, for reparsing, I only want to do this if the external dependency is already there.
But I can't think how to run tests only under some circumstances. Is there any way of specifying "run this test if Java is available on the machine, otherwise don't"?
That leaves the test running,and passing, when it should show up as ignored.
The best I have got at the moment is to put all the tests behind a specific feature gate. So, then they have to be turned on. I guess that is not such a bad thing.