[CMake] CTest return value in the case of an build error

Floca Ralf Omar r.floca at dkfz-heidelberg.de
Thu Dec 11 04:17:14 EST 2008


> Bill Hoffman wrote:
> > Clinton Stimpson wrote:
> >>
> >> +1 for this. I ended up having to parse the xml files myself, as I
> >> couldn't find an easier way to get the info I wanted.
> >> I submitted a request for this.
> >> http://public.kitware.com/Bug/view.php?id=8277
> >>
> >> I was trying to use ctest as a replacement for a non-portable shell
> >> script that did nightly testing.
> >>
> >
> > All of the commands have RETURN_VALUE...
> >
> > ctest_build(..  RETURN_VALUE val)
> > ctest_update( ..  RETURN_VALUE val)
> > ctest_test(..  RETURN_VALUE val)
> > ctest_configure(..  RETURN_VALUE val)
> >
> > It is in the documentation for the commands...
> >
> > Is that what you want?
> >
> > -Bill
> 
>  From testing those commands, it appears they only return error if the
> attempt to do the operation failed, not if the operation itself had
> errors.
> I couldn't get if the build failed from ctest_build() using the VS
2005
> generator (I got a 0 for build failures and build success).  I also
> couldn't get the number of test failures from ctest_test().  I need
> that
> information so I can decide whether to package up some binaries and do
> something with them.
> 
> As for the documentation at
> http://www.cmake.org/cmake/help/ctest2.6docs.html
> For ctest_build() it say, "Builds the given build directory and stores
> results in Build.xml."  It doesn't say anything about the return
value,
> but in experimenting, it returned -1 if it couldn't start the build
> process, and 0 for anything else.
> For ctest_test() it says "Tests the given build directory and stores
> results in Test.xml. The second argument is a variable that will hold
> value."  Valuable, or has a value?  :)  But what values can I get back
> from it?
> 
> Clint

First of all thank you for the quick response.
(@ Clint: and thanks for submitting the request, it is a perfect match
to my own request.)

As for the CTEST_[...] commands, they seem to be the solution, but as
Clint already mentioned, the problem is that the RETURN_VALUE of
CTEST_BUILD is 0 when it was possible to trigger the build, even when at
least one project build has failed. For nearly the same reason Clint
mentioned I need to differ between "failed to executed building
process", "build was executed, but error(s) occurred", "building was
successful" and may be as a nice to have "building was successful, but
warning(s) occurred". That seems not to be possible by RETURN_VALUE
right now. But please correct me if I am mistaken.

Kind regards,

Ralf Floca

------------------------------------------------------------------
Ralf Floca
DKFZ
German Cancer Research Center (Deutsches Krebsforschungszentrum) 
Member of the Helmholtz Association
E071 Research Group
Software Development for Integrated Diagnostics and Therapy (SIDT)

Im Neuenheimer Feld 280
D-69120 Heidelberg

Telefon: +49 (6221) 42 3021
E-Mail: r.floca at dkfz.de
Web: www.dkfz.de
------------------------------------------------------------------


More information about the CMake mailing list