[CMake] how to ctest with pre- and -post processing

TS tzsariysk at gmail.com
Wed Jun 29 15:20:57 EDT 2016


Hi,

 

Is it possible to have a ctest which involves preprocessing as well as postprocessing. The code I want to test is myCode.exe, which writes an output file OUTPUT. Measure for success is a comparison of OUTPUT against REFERENCE data file. Currently, I use two add_tests:

 

ADD_TEST(code_for_test                 mpiexec  --np 8 myCode.exe input OUTPUT)

ADD_TEST(measure_for_success     compare.exe OUTPUT REFERENCE 1.e-6)

 

It works, but I believe there are better ways to achieve this. Also, I would like to have a preprocessing step, which removes OUTPUT before running myCode.exe, just to make sure that the comparison is always against the current OUTPUT and not against OUTPUT left from previous runs. What I have in mind is: 

            

            Remove OUTPUT                                                       ß preprocessing step

            Run myCode.exe                                                         ß the code being tested

            Compare OUTPUT against REFERENCE data.              ß measure for PASS/FAIL

 

Thanks in advance,

Ted

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160629/9f7a64e4/attachment.html>


More information about the CMake mailing list