I wrote an application in C++ that throws exceptions, and catch sends error messages to cerr.
Now I am writing a tester in C++ that calls the application.
The tester should compare the application's error messages to expected error messages.
The tester uses system() to run the application; but am at a lose as how to capture the application's error messages.
system() function does not return the cerr messages. http://www.cplusplus.com/reference/cstdlib/system/
Is there a way the tester can run the application and capture the application's error messages?
This is suitable for one-way communication only (the use of std::system() implies this is acceptable). You will need to use the system's shell syntax to redirect standard error to you.