script.cmake:<br>execute_process(x)<br>execute_process(y)<br><br>CMakeLists.txt:<br>add_test(NAME MyTest COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/script.cmake)<br><br>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.<br>
<br>The NAME/COMMAND signature of add_test is only available in 2.8 and later, though.<br><br><br>HTH,<br>David<br><br><br><div class="gmail_quote">On Mon, May 2, 2011 at 1:41 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Mon, May 2, 2011 at 1:31 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
> If it's supposed to be "one test" from ctest's point of view, you should<br>
> write a script that makes 2 execute_process calls, and run the script as the<br>
> add_test command.<br>
<br>
</div>I tried to write a function that runs to executables, and add that<br>
function to the test:<br>
<br>
cmake_minimum_required(VERSION 2.6)<br>
<br>
PROJECT(Test)<br>
ENABLE_TESTING()<br>
<br>
ADD_EXECUTABLE(Test1 Test1.cxx)<br>
ADD_EXECUTABLE(Test2 Test2.cxx)<br>
<br>
function(RunTest x y)<br>
execute_process(x)<br>
execute_process(y)<br>
endfunction()<br>
<br>
add_test(MyTest RunTest(Test1 Test2))<br>
<br>
but I get the error:<br>
<br>
Unable to find executable: RunTest<br>
<br>
This must not be what you mean by "a script"?<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br>