Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Özgür Ozan Sen
ogs
Commits
c3b4e85b
Verified
Commit
c3b4e85b
authored
3 years ago
by
Lars Bilke
Browse files
Options
Downloads
Patches
Plain Diff
Use xsltproc to transform ctest error output.
parent
112b3d03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+2
-0
2 additions, 0 deletions
.gitlab-ci.yml
scripts/ci/extends/template-build-linux.yml
+11
-1
11 additions, 1 deletion
scripts/ci/extends/template-build-linux.yml
scripts/test/ctest-error-output.xsl
+38
-0
38 additions, 0 deletions
scripts/test/ctest-error-output.xsl
with
51 additions
and
1 deletion
.gitlab-ci.yml
+
2
−
0
View file @
c3b4e85b
...
...
@@ -18,6 +18,8 @@ variables:
BUILD_PROCESSES
:
"
"
# Empty string: builds all processes
BUILD_TESTS
:
"
true"
BUILD_CTEST
:
"
true"
# Test config
NUM_CTEST_ERROR_LINES
:
1000
# tail this much lines from failed output
workflow
:
rules
:
...
...
This diff is collapsed.
Click to expand it.
scripts/ci/extends/template-build-linux.yml
+
11
−
1
View file @
c3b4e85b
...
...
@@ -22,7 +22,17 @@
if [[ -z "$TARGETS" ]]; then
$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_CTEST" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target ctest ; fi
if [ "$BUILD_CTEST" = true ]; then
ctest_exit=0
ctest -T Test --no-compress-output --exclude-regex LARGE --timeout 900 || ctest_exit=$?
if [ $ctest_exit -ne 0 ]; then
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
fi
if [ "$BUILD_CTEST_LARGE" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target ctest-large ; fi
if [ "$BUILD_CTEST" = true ] ; then cp Testing/**/Test.xml Tests/ctest.xml ; fi
if [ "$BUILD_CTEST_LARGE" = true ] ; then cp Testing/**/Test.xml Tests/ctest-large.xml ; fi
...
...
This diff is collapsed.
Click to expand it.
scripts/test/ctest-error-output.xsl
0 → 100644
+
38
−
0
View file @
c3b4e85b
<?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=
"' '"
/>
<xsl:value-of
select=
"' '"
/>
<xsl:call-template
name=
"value-of-template"
>
<xsl:with-param
name=
"select"
select=
".//Results/Measurement/Value/text()"
/>
</xsl:call-template>
<xsl:value-of
select=
"' '"
/>
<xsl:text>
[ctest end]
</xsl:text>
<xsl:value-of
select=
"' '"
/>
<xsl:value-of
select=
"' '"
/>
</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()>1]"
>
<xsl:value-of
select=
"' '"
/>
<xsl:value-of
select=
"."
/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment