#5718 Supply DTD/XSD/RNG for cppcheck XML output - supply rng for current XML output. Add an automatic check on travis against the --errorlist output
This commit is contained in:
parent
2b14b71c93
commit
64f0d31280
|
@ -75,6 +75,8 @@ script:
|
|||
- sh -c "! grep '^\[' /tmp/cppcheck.cppcheck"
|
||||
# run extra tests
|
||||
- tools/generate_and_run_more_tests.sh
|
||||
# Validate XML
|
||||
- make validateXMLV2
|
||||
# check test/cfg
|
||||
- make checkcfg
|
||||
- make validateCFG
|
||||
|
|
7
Makefile
7
Makefile
|
@ -316,6 +316,13 @@ PlatformFilesCHECKED := $(patsubst %.xml,%.checked,$(PlatformFiles))
|
|||
xmllint --noout --relaxng platforms/cppcheck-platforms.rng $<
|
||||
validatePlatforms: ${PlatformFilesCHECKED}
|
||||
|
||||
# Validate XML output (to detect regressions)
|
||||
/tmp/errorlist.xml: cppcheck
|
||||
cppcheck --errorlist >$@
|
||||
.PHONY: validateXMLV2
|
||||
validateXMLV2: /tmp/errorlist.xml
|
||||
xmllint --noout --relaxng xmlV2.rng $<
|
||||
|
||||
|
||||
###### Build
|
||||
|
||||
|
|
|
@ -414,6 +414,12 @@ int main(int argc, char **argv)
|
|||
fout << "%.checked:%.xml\n";
|
||||
fout << "\txmllint --noout --relaxng platforms/cppcheck-platforms.rng $<\n";
|
||||
fout << "validatePlatforms: ${PlatformFilesCHECKED}\n\n";
|
||||
fout << "# Validate XML output (to detect regressions)\n";
|
||||
fout << "/tmp/errorlist.xml: cppcheck\n";
|
||||
fout << "\tcppcheck --errorlist >$@\n";
|
||||
fout << ".PHONY: validateXMLV2\n";
|
||||
fout << "validateXMLV2: /tmp/errorlist.xml\n";
|
||||
fout << "\txmllint --noout --relaxng xmlV2.rng $<\n\n";
|
||||
|
||||
fout << "\n###### Build\n\n";
|
||||
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||
<start>
|
||||
<element name="results">
|
||||
<attribute name="version">
|
||||
<data type="integer"/>
|
||||
</attribute>
|
||||
<element name="cppcheck">
|
||||
<attribute name="version"/>
|
||||
</element>
|
||||
<element name="errors">
|
||||
<oneOrMore>
|
||||
<element name="error">
|
||||
<optional>
|
||||
<attribute name="cwe">
|
||||
<data type="integer"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<attribute name="id">
|
||||
<data type="NCName"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="inconclusive">
|
||||
<data type="boolean"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<attribute name="msg"/>
|
||||
<attribute name="severity">
|
||||
<data type="NCName"/>
|
||||
</attribute>
|
||||
<attribute name="verbose"/>
|
||||
<choice>
|
||||
<element name="location">
|
||||
<attribute name="file"/>
|
||||
<attribute name="line">
|
||||
<data type="integer"/>
|
||||
</attribute>
|
||||
</element>
|
||||
<zeroOrMore>
|
||||
<element name="symbol">
|
||||
<data type="string"/>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
</choice>
|
||||
</element>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</element>
|
||||
</start>
|
||||
</grammar>
|
Loading…
Reference in New Issue