I’ve got a rust project that currently consists of a single [[bin]] target (but that could trivially be split up into a bin and a lib - main.rs does some trivial initialization and then calls a single method in a sub-module).
I’m about to write some code that will involve running a sub-process. The easiest way I can think of to test this is to create a binary that just writes its command-line args and working directory to a temp file. The test can then make the code that should run the sub-process, then check that the output file was created and contains the expected args and working directory.
The problem is how do I tell Cargo “before you run the tests in module A, make sure that you’ve built binary B”. Any suggestions?