script.cmake:
execute_process(x)
execute_process(y)

CMakeLists.txt:
add_test(NAME MyTest COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_SOURCE_DIR}/script.cmake)

Or, configure the script into the build tree if you need variable values
from the CMakeLists.txt file and then reference the configured copy instead.

The NAME/COMMAND signature of add_test is only available in 2.8 and later,
though.


HTH,
David


On Mon, May 2, 2011 at 1:41 PM, David Doria <daviddo...@gmail.com> wrote:

> On Mon, May 2, 2011 at 1:31 PM, David Cole <david.c...@kitware.com> wrote:
> > If it's supposed to be "one test" from ctest's point of view, you should
> > write a script that makes 2 execute_process calls, and run the script as
> the
> > add_test command.
>
> I tried to write a function that runs to executables, and add that
> function to the test:
>
> cmake_minimum_required(VERSION 2.6)
>
> PROJECT(Test)
> ENABLE_TESTING()
>
> ADD_EXECUTABLE(Test1 Test1.cxx)
> ADD_EXECUTABLE(Test2 Test2.cxx)
>
> function(RunTest x y)
>  execute_process(x)
>  execute_process(y)
> endfunction()
>
> add_test(MyTest RunTest(Test1 Test2))
>
> but I get the error:
>
> Unable to find executable: RunTest
>
> This must not be what you mean by "a script"?
>
> David
>
_______________________________________________
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to