Skip to content
Snippets Groups Projects
Verified Commit 6f6fc4f8 authored by Lars Bilke's avatar Lars Bilke
Browse files

Revert "Use xsltproc to transform ctest error output."

This reverts commit c3b4e85b.
parent bef6e6a4
No related branches found
No related tags found
No related merge requests found
...@@ -18,8 +18,6 @@ variables: ...@@ -18,8 +18,6 @@ variables:
BUILD_PROCESSES: "" # Empty string: builds all processes BUILD_PROCESSES: "" # Empty string: builds all processes
BUILD_TESTS: "true" BUILD_TESTS: "true"
BUILD_CTEST: "true" BUILD_CTEST: "true"
# Test config
NUM_CTEST_ERROR_LINES: 1000 # tail this much lines from failed output
workflow: workflow:
rules: rules:
......
...@@ -22,25 +22,11 @@ ...@@ -22,25 +22,11 @@
if [[ -z "$TARGETS" ]]; then if [[ -z "$TARGETS" ]]; then
$BUILD_CMD_PREFIX cmake --build . --target package > >(tee make.output) $BUILD_CMD_PREFIX cmake --build . --target package > >(tee make.output)
if [ "$BUILD_TESTS" = true ]; then $BUILD_CMD_PREFIX cmake --build . --target tests ; fi if [ "$BUILD_TESTS" = true ]; then $BUILD_CMD_PREFIX cmake --build . --target tests ; fi
if [ "$BUILD_CTEST" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target ctest ; fi
if [ "$BUILD_CTEST" = true ]; then
ctest_labels="default"
ctest_timeout=15
if [ "$BUILD_CTEST_LARGE" = true ]; then
ctest_labels="large|$ctest_labels"
ctest_timeout=90
fi
ctest_exit=0
if [[ "$OSTYPE" == "darwin"* ]]; then alias date=gdate ; fi if [[ "$OSTYPE" == "darwin"* ]]; then alias date=gdate ; fi
ctest -T Test --no-compress-output -L "$ctest_labels" --repeat until-pass:2 --stop-time `date -d "today + ${ctest_timeout} minutes" +'%H:%M:%S'` || ctest_exit=$? ctest -T Test --no-compress-output -L "$ctest_labels" --repeat until-pass:2 --stop-time `date -d "today + ${ctest_timeout} minutes" +'%H:%M:%S'` || ctest_exit=$?
if [ $ctest_exit -ne 0 ]; then if [ "$BUILD_CTEST" = true ] ; then cp Testing/**/Test.xml Tests/ctest.xml ; fi
echo "ctests failed (showing the last ${NUM_CTEST_ERROR_LINES} lines):"
xsltproc ${CI_PROJECT_DIR}/scripts/test/ctest-error-output.xsl Testing/*/Test.xml | tail -n ${NUM_CTEST_ERROR_LINES}
exit $ctest_exit
fi
cp Testing/**/Test.xml Tests/ctest.xml cp Testing/**/Test.xml Tests/ctest.xml
fi
else else
$BUILD_CMD_PREFIX cmake --build . --target ${TARGETS} > >(tee make.output) $BUILD_CMD_PREFIX cmake --build . --target ${TARGETS} > >(tee make.output)
fi fi
......
<?xml version="1.0"?>
<!-- Was created with:
xmlstarlet sel -C -t \
-m "//*/Testing/Test[@Status='failed']" \
-o '[ctest] ' -v './/Name' -o ':' -n -n \
-v './/Results/Measurement/Value/text()' -n \
-o '[ctest end]' -n -n \
Testing/20210510-0943/Test.xml > ctest-error-output.xsl
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common" version="1.0" extension-element-prefixes="exslt">
<xsl:output omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/">
<xsl:for-each select="//*/Testing/Test[@Status='failed']">
<xsl:text>[ctest] </xsl:text>
<xsl:call-template name="value-of-template">
<xsl:with-param name="select" select=".//Name"/>
</xsl:call-template>
<xsl:text>:</xsl:text>
<xsl:value-of select="'&#10;'"/>
<xsl:value-of select="'&#10;'"/>
<xsl:call-template name="value-of-template">
<xsl:with-param name="select" select=".//Results/Measurement/Value/text()"/>
</xsl:call-template>
<xsl:value-of select="'&#10;'"/>
<xsl:text>[ctest end]</xsl:text>
<xsl:value-of select="'&#10;'"/>
<xsl:value-of select="'&#10;'"/>
</xsl:for-each>
</xsl:template>
<xsl:template name="value-of-template">
<xsl:param name="select"/>
<xsl:value-of select="$select"/>
<xsl:for-each select="exslt:node-set($select)[position()&gt;1]">
<xsl:value-of select="'&#10;'"/>
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment