[CMake] Ctest logs error but returns zero exit code.

Mike Nicholson Mike.Nicholson at viavisolutions.com
Fri Jan 6 15:41:11 EST 2017


Hello,

I recently ran into a situation where one of our scripts was attempting to run CTest in the wrong directory.   CTest did output a helpful error message:

    *********************************
    No test configuration file found!
    *********************************
    Usage

      ctest [options]

But it still returned an exit code of zero.  This behavior seems to be counterintuitive. CTest checks for the error condition (no arguments are specified at command line and the default CMake or Dart TestFile doesn’t exist) and logs the error but does not update the exit code accordingly.

I’d be happy to contribute a patch but before investing the time to do so I’d like to understand if this is expected behavior and if so the reasoning behind it.

Thanks,
Mike Nicholson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170106/216d597b/attachment-0001.html>


More information about the CMake mailing list