#!/bin/bash # This example script takes the XML output of a gtest run and formats # it as HTML. It can easily be adapted to other XML test output formats # such as JUnit or CTest # Prepare xml with ./path/to/test --gtest_output=xml:path/to/output.xml # Usage: format-test-results test_result.xml > output.html if [ ! -f "$1" ]; then echo "File not found: \"$1\"" exit 1 fi xsltproc --stringparam JOB $JOB --stringparam RUN $RUN <(cat <<\EOF Test report for <xsl:value-of select="$JOB" /> #<xsl:value-of select="$RUN" />

#

Test Report

Suite Tests run Failures Errors Elapsed time
failure success

EOF ) "$1"