diff --git a/.travis.yml b/.travis.yml index 9c2ec12af..747011035 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Makefile b/Makefile index e063c0656..146a3a6a6 100644 --- a/Makefile +++ b/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 diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 542844ea3..cf92a3d4b 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -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"; diff --git a/xmlV2.rng b/xmlV2.rng new file mode 100644 index 000000000..235eb54fc --- /dev/null +++ b/xmlV2.rng @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +