mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Fix caps and highlight embedded code-blocks
11
JUnit.md
11
JUnit.md
@@ -1,9 +1,10 @@
|
||||
## Getting JUnit XML from ShellCheck
|
||||
|
||||
ShellCheck does not have a JUnit XML formatter, but here you can find `checkstyle2junit.xslt`, a XSLT program that converts from Checkstyle XML output to JUnit XML.
|
||||
ShellCheck does not have a JUnit XML formatter, but here you can find `checkstyle2junit.xslt`, an XSLT program that converts from CheckStyle's XML output to JUnit's XML.
|
||||
|
||||
Here's shellcheck's checkstyle XML output:
|
||||
Here's ShellCheck's (CheckStyle-compatible) XML output:
|
||||
|
||||
```console
|
||||
$ shellcheck -f checkstyle foo.bash bar.bash
|
||||
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
@@ -15,9 +16,11 @@ Here's shellcheck's checkstyle XML output:
|
||||
<file name='bar.bash'>
|
||||
</file>
|
||||
</checkstyle>
|
||||
```
|
||||
|
||||
Here it is with the XSLT applied using `xmlstarlet`:
|
||||
|
||||
```console
|
||||
$ shellcheck -f checkstyle foo.bash bar.bash | xmlstarlet tr checkstyle2junit.xslt
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
@@ -29,9 +32,10 @@ Here it is with the XSLT applied using `xmlstarlet`:
|
||||
<testcase classname="bar.bash" name="bar.bash">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
```
|
||||
|
||||
`checkstyle2junit.xslt`:
|
||||
|
||||
```xslt
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output encoding="UTF-8" method="xml"></xsl:output>
|
||||
@@ -76,3 +80,4 @@ Here it is with the XSLT applied using `xmlstarlet`:
|
||||
</failure>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
```
|
||||
|
Reference in New Issue
Block a user