[CMake] Ctest and custom measurements

David Cole dlrdave at aol.com
Wed Jul 30 06:48:23 EDT 2014


Unfortunately, I always have to resort to source code analysis to
figure this stuff out... NamedMeasurement is only mentioned in the file
Source/CTest/cmCTestTestHandler.cxx :
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CTest/cmCTestTestHandler.cxx;hb=refs/heads/master 



(search the page for NamedMeasurement, and see the function
cmCTestTestHandler::GenerateRegressionImages in particular...)

Transform your output (if you can) into using "DartMeasurement" style
XML tags as shown in this post from 4 years ago:
http://www.cmake.org/pipermail/cmake/2010-April/036574.html

Quoting from that 4-year-old post:
To send a number (for example, 42) as a measurement named "Simple", try
printing output like this on stdout:
<DartMeasurement name="Simple"
type="numeric/integer">42</DartMeasurement>
<DartMeasurement name="pi"
type="numeric/double">3.14159</DartMeasurement>

CTest should parse the DartMeasurement tags from the output and
generate the NamedMeasurement XML that CDash is expecting.

It is a little bit ridiculous to use the legacy format in the output,
which ctest recognizes, and then transforms into what CDash needs, but
it is what is necessary at the moment. You are trying to send what
CDash needs directly, but it gets encoded into the "output" of the
test, rather than recognized like the legacy format....

One of these days, perhaps an easier way will find its way into the
source code.

For now, try the legacy technique and let us know if it works out for
you.


HTH,
David C.




-----Original Message-----
From: ycollette.nospam <ycollette.nospam at free.fr>
To: cmake <cmake at cmake.org>
Sent: Tue, Jul 29, 2014 10:44 am
Subject: [CMake] Ctest and custom measurements


Hello,

I've got an executable built using cmake.
I use ctest to test my executable. Each time the executable is
executed, a log
file on std::cout is produced.
I the log file, I added the following XML tags:

<NamedMeasurement name="my measure"
type="numeric/double"><Value>0.33</Value></NamedMeasurement>

I don't see these named measurements in the xml file produced by ctest
-D
NighlyStart ; ctest -D NighlyTest

I use cmake-2.8.12.2 under Fedora 20 64 bits.

Is it possible to add custom measurements in the xml file generated by
ctest ?

Best regards,

YC



More information about the CMake mailing list