In fact it turns out that you write a system test. Consequently, you should have already compiled application.
The easiest option in this case -- it just call the application using std::system
, and test the output. As std::system just returns the exit code, output you can write to any file. And then, as in the usual test, to compare what happened and what should happen. In fact you have two applications: the test itself and the tool you are testing.