[CMake] testing with standard output

Bill Hoffman bill.hoffman at kitware.com
Tue Jul 14 09:43:55 EDT 2009


Henrique Almeida wrote:
>  Hello,
> 
>  When running "make test", some of my unit tests require that the
> result is given by a correct output, instead of (just) the correct
> return value (because, I'm specifically testing the ability to do
> output). Is there a way to configure CTest to report a successful
> result for certain tests by comparing their outputs to a reference
> output ?
> 
>  In the most general case I'd need something like:
> 
>  add_test(test source1 source2 INPUT test.input EXPECTED_OUTPUT
> test.output EXPECTED_ERROR test.error)
> 
>  I'd provide test.input as stdin, test.output as expected stdout and
> test.error as expected stderr.
> 


http://www.cmake.org/cmake/help/cmake2.6docs.html#section_Properties%20on%20Tests


-Bill


More information about the CMake mailing list