On Wed, Dec 17, 2008 at 1:01 AM, Tron Thomas <span dir="ltr"><<a href="mailto:tron.thomas@verizon.net">tron.thomas@verizon.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Hey Philip,<br>
I tried both the flag and exporting the environment variable. Neither
method produced the output from the test application when the test
failed.<br>
What is needed to used this feature?</div></blockquote><div><br>Tron,<br><br>You'll need to patch CVS CMake with the patch attached here.<br>
<a href="http://public.kitware.com/Bug/view.php?id=8255">http://public.kitware.com/Bug/view.php?id=8255</a><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000"><div><div></div><div class="Wj3C7c"><br>
<br>
Philip Lowman wrote:
<blockquote type="cite">On Sun, Dec 7, 2008 at 5:44 PM, Tron Thomas <span dir="ltr"><<a href="mailto:tron.thomas@verizon.net" target="_blank">tron.thomas@verizon.net</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It
would be nice if the original "test" and RUN_TESTS targets could be
configured this way without having to create and additional target that
replaces them.</blockquote>
<div><br>
Patch attached here:<br>
<a href="http://public.kitware.com/Bug/view.php?id=8255" target="_blank">http://public.kitware.com/Bug/view.php?id=8255</a><br>
<br>
Here's a start at this that doesn't break existing behavior. If the
user specifies a "--output-on-failure" flag to CTest or defines the
environment variable CTEST_OUTPUT_ON_FAILURE then when a test fails,
CTest will output whatever the test program outputted to the screen.
Usually this should be the test assertion(s) that failed. Here's an
example of what it might look like when using CxxTest.<br>
<br>
user@ubuntu:~/src/test_cmake_cxxtest/build$ echo "export
CTEST_OUTPUT_ON_FAILURE=1" >> ~/.bashrc<br>
user@ubuntu:~/src/test_cmake_cxxtest/build$ source ~/.bashrc<br>
user@ubuntu:~/src/test_cmake_cxxtest/build$ make test<br>
Running tests...<br>
Start processing tests<br>
Test project /home/user/src/test_cmake_cxxtest/build<br>
1/ 3 Testing unittest_addition ............ Passed<br>
2/ 3 Testing unittest_addition_fail .......<br>
*** Test Failed:<br>
Running 1 test<br>
In MyTestSuite::testAddition:<br>
/home/user/src/test_cmake_cxxtest/addition_failure.h:8: Error: Expected
(1 + 1 == 3), found (2 != 3)<br>
Failed 1 of 1 test<br>
Success rate: 0%<br>
<br>
***Failed <br>
3/ 3 Testing unittest_subtraction ......... Passed<br>
<br>
67% tests passed, 1 tests failed out of 3<br>
<br>
The following tests FAILED:<br>
2 - unittest_addition_fail (Failed)<br>
Errors while running CTest<br>
make: *** [test] Error 8<br>
<br>
<br>
</div>
</div>
<br>
-- <br>
Philip Lowman<br>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Philip Lowman<br>