MantisBT - CMake
View Issue Details
0009128CMakeCTestpublic2009-06-10 02:372016-06-10 14:30
Maik Beckmann 
Bill Hoffman 
normalminoralways
closedmoved 
CMake-2-6 
 
0009128: [Fortran] --output-on-failure option doesn't work with FAIL_REGULAR_EXPRESSION
Running
  ctest --output-on-failure
doesn't work for programs which returns 0, but fail because FAIL_REGULAR_EXPRESSION matches.

This hits Fortran programs which have no return value.
unpack the attached
  ctest_fortran_test.tar.gz
configure, build it and run
  /path/to/cvs/ctest --output-on-failure
The code which handles this option is in
  cmCTest.cxx
{{{
  int cmCTest::RunTest(std::vector<const char*> argv,
                     std::string* output, int *retVal,
                     std::ostream* log, double testTimeOut,
                     std::vector<std::string>* environment)
{
...
    *retVal = cmsysProcess_GetExitValue(cp);
    if(*retVal != 0 && this->OutputTestOutputOnTestFailure)
      {
        OutputTestErrors(tempOutput);
      }
    }
  else if(result == cmsysProcess_State_Exception)
    {
    if(this->OutputTestOutputOnTestFailure)
      {
        OutputTestErrors(tempOutput);
      }
...
}}}

Value of FAIL_REGULAR_EXPRESSION is evaluated in
  cmCTestTestHandler.cxx: cmCTestTestHandler::ProcessHandler()
which calls cmCTest::RunTest.

So the logic of output-on-failure might be better placed in cmCTestTestHandler::ProcessHandler()
No tags attached.
gz ctest_fortran_test.tar.gz (422) 2009-06-10 02:37
https://public.kitware.com/Bug/file/2307/ctest_fortran_test.tar.gz
patch ctest_output_on_failure.patch (2,614) 2009-06-10 03:18
https://public.kitware.com/Bug/file/2308/ctest_output_on_failure.patch
Issue History
2009-06-10 02:37Maik BeckmannNew Issue
2009-06-10 02:37Maik BeckmannFile Added: ctest_fortran_test.tar.gz
2009-06-10 03:18Maik BeckmannFile Added: ctest_output_on_failure.patch
2009-06-10 03:21Maik BeckmannNote Added: 0016685
2009-06-10 03:51Maik BeckmannNote Added: 0016686
2009-06-10 09:01Bill HoffmanStatusnew => assigned
2009-06-10 09:01Bill HoffmanAssigned To => Bill Hoffman
2009-07-07 15:43Maik BeckmannNote Added: 0016826
2016-06-10 14:27Kitware RobotNote Added: 0041568
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0016685)
Maik Beckmann   
2009-06-10 03:21   
ctest_output_on_failure.patch moves the logic that handles
  --output-on-failure
from cmCTest.cxx to cmCTestTestHander.cxx

-- Maik
(0016686)
Maik Beckmann   
2009-06-10 03:51   
narf, in the patch

+ bool GetOutputTestOutputOnTestFailure()
+ { return this->OutputTestOutputOnTestFailure; }

should be

+ bool GetOutputTestOutputOnTestFailure() const
+ { return this->OutputTestOutputOnTestFailure; }

for the sake of const correctness

-- Maik
(0016826)
Maik Beckmann   
2009-07-07 15:43   
ping
(0041568)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.