diff --git a/examples/format-test-results b/examples/format-test-results index f199147..720cb81 100755 --- a/examples/format-test-results +++ b/examples/format-test-results @@ -1,21 +1,117 @@ #!/bin/bash -cat < - - - - -Laminar - - - -
-

Test report for $lJobName #$lBuildNum

-EOF -xsltproc "$(dirname ${BASH_SOURCE[0]})/testreport.xsl" "$1"; -cat < - +# 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

+ + + + + + + + + + + +
SuiteTests runFailuresErrorsElapsed time
+ +
+ + + + + failure + success + + + + + + + + + + + + + + +
+ +
+ + +
+ + + + + +
+
+ +
+
+ +
+ +
+
+
+
+ + +
+ + + +
+
+ +
+ EOF +) "$1" diff --git a/examples/junit-bs-style.xsl b/examples/junit-bs-style.xsl deleted file mode 100644 index 3fc9964..0000000 --- a/examples/junit-bs-style.xsl +++ /dev/null @@ -1,42 +0,0 @@ - - - - -

Test Suite:

-
-
Tests run:
-
Failures:
-
Errors:
-
Elapsed time:
-
-
    - -
- - -
- - - - -
  • - -
  • -
    - -
  • -
    -
    -
    - - -
    -
    -
    -
    - -
    Standard output:
    -
    Standard error:
    - -
    -