The easiest way to separate output is to wrap your test in a cmake -P script, and then inside that call execute_process to run the &quot;real test&quot; and use its facilities to capture output into variables or redirect output to files.<br>
<br><div>There is no redirection of output using add_test arguments.</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Wed, Jul 28, 2010 at 12:01 PM, Emmanuel Blot <span dir="ltr">&lt;<a href="http://eblot.ml">eblot.ml</a>@<a href="http://gmail.com">gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I&#39;d like to run some static analysis tool from CTest. (2.8.1)<br>
<br>
I&#39;ve added enable_testing() and add_test() calls in my CMakeLists.txt<br>
file, and the static analysis tool is invoked as expected, however:<br>
  * CTest discards both the tool standard output and tool standard<br>
error stream when ran with no option, which makes the purpose of the<br>
analysis useless;<br>
  * CTest preserves both tool stream outputs when run with the -V<br>
option, but add its own output messages to the resulting info, which<br>
makes the analysis output nearly impossible to read.<br>
<br>
1/ Is it possible to keep the standard error stream from the tool and<br>
to discard CTest ouput and the tool&#39;s stdout ?<br>
2/ It does not seem CTest follows the same convention as CMake&#39;s<br>
ADD_CUSTOM_COMMAND which accepts an &#39;ARGS&#39; argument and stream<br>
redirection (using &#39;&gt;&#39;). What&#39;s the equivalent syntax in CTest?<br>
<br>
Thanks,<br>
Manu<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>