It works as follows
  1. ctest runs

  2. create an index of all generated xml files 
  {{{
  <Files>
    <file>Update.xml</file>
    <file>Configure.xml</file>
    <file>Test.xml</file>
     ...
  </Files>
  }}}

  3. run an xsl processor on this index with an xsl file sucking in all listed 
result files
  {{{
  <xsl:template match="/">
    <testsuites>
      <xsl:for-each select="/Files">
        <xsl:for-each select="document(File/text())">
          <xsl:apply-templates select="Site"/>
        </xsl:for-each>
      </xsl:for-each>
    </testsuites>
  </xsl:template>
  }}}


- The "create an index of all generated xml files" step in detail:

If ctest performs it's duties a bunch of XML files is stored in
  ${CTEST_BINARY_DIRECTORY}/Testing/${SOME_DATE}/
The value of SOME_DATE is stored in   
  ${CTEST_BINARY_DIRECTORY}/Testing/TAG
SOME_DATE can be extracted via
{{{
  file(STRINGS "${CTEST_BINARY_DIRECTORY}/Testing/TAG" _tag_content)
  list(GET _tag_content 0 SOME_DATE)
}}}
Now 
{{{
  file(GLOB 
_result_files "${CTEST_BINARY_DIRECTORY}/Testing/${SOME_DATE}/*.xml")
}}}
gives the list of the xml files created by ctest during it's last run.  
index.xml is created via file(WRITE and foreach.

For a working example see the attached tarball.

Best,
 -- Maik

Attachment: ctest_xml_transform.tar.gz
Description: application/tgz

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to