Ok thanks

Would it be an opinion to have a COMMAND parameter for the add_test function 
like execute_process where every COMMAND must return the exit code and this 
would be ored?

add_test(MyTest COMMAND myserver --port 80
                              COMMAND mytest 
                              COMMAND myserver --graceful-shutdown)

Or

add_test(MyTest PRE_COMMAND myserver --port 80
                              COMMAND mytest 
                              POST_COMMAND myserver --graceful-shutdown)

Best Regards
Roman

> Am 16.02.2016 um 16:49 schrieb Brad King <[email protected]>:
> 
>> On 02/16/2016 07:17 AM, Roman Wüger wrote:
>> Is it possible with CMake >= 3.4.0 to run a program/command before the
>> test and another program after the test was run?
>> 
>> The meaning of that would be, that I want to start a small server
>> program and run the "client" test. After the test was finished,
>> kill the process of the server program or do a graceful shutdown of it.
> 
> There is currently no builtin feature for that.  Other than a few
> test output matching properties, ctest always expects the process
> to be independent and report results via its exit code.
> 
> -Brad
> 
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to