<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hey Philip,<br>
I tried both the flag and exporting the environment variable.&nbsp; Neither
method produced the output from the test application when the test
failed.<br>
What is needed to used this feature?<br>
<br>
Philip Lowman wrote:
<blockquote
 cite="mid:f168bb790812071903r2671be58jf490e18d41489389@mail.gmail.com"
 type="cite">On Sun, Dec 7, 2008 at 5:44 PM, Tron Thomas <span
 dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:tron.thomas@verizon.net" target="_blank">tron.thomas@verizon.net</a>&gt;</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 moz-do-not-send="true"
 href="http://public.kitware.com/Bug/view.php?id=8255">http://public.kitware.com/Bug/view.php?id=8255</a><br>
  <br>
Here's a start at this that doesn't break existing behavior.&nbsp; 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.&nbsp;
Usually this should be the test assertion(s) that failed.&nbsp; 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" &gt;&gt; ~/.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>
&nbsp; 1/&nbsp; 3 Testing unittest_addition ............&nbsp;&nbsp; Passed<br>
&nbsp; 2/&nbsp; 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>
&nbsp; 3/&nbsp; 3 Testing unittest_subtraction .........&nbsp;&nbsp; Passed<br>
  <br>
67% tests passed, 1 tests failed out of 3<br>
  <br>
The following tests FAILED:<br>
&nbsp;&nbsp;&nbsp; &nbsp; 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>
</body>
</html>