From ceff09d491cd5ccce771f0f2026da3fa6221ab8f Mon Sep 17 00:00:00 2001 From: amai2012 Date: Thu, 24 May 2018 16:12:43 +0200 Subject: [PATCH] #5178 Supply DTD/(XSD/RNG for cppcheck XML output. Add target to Makefile to create and validate XML from regular run. Update xmlV2.rng accordingly. --- Makefile | 9 +++-- tools/dmake.cpp | 8 +++- xmlV2.rng | 105 +++++++++++++++++++++++++----------------------- 3 files changed, 67 insertions(+), 55 deletions(-) mode change 100644 => 100755 xmlV2.rng diff --git a/Makefile b/Makefile index 146a3a6a6..0166330e5 100644 --- a/Makefile +++ b/Makefile @@ -319,10 +319,13 @@ validatePlatforms: ${PlatformFilesCHECKED} # Validate XML output (to detect regressions) /tmp/errorlist.xml: cppcheck cppcheck --errorlist >$@ +/tmp/example.xml: cppcheck + cppcheck --xml --inconclusive -j 4 cli externals gui lib test 2>/tmp/example.xml +createXMLExamples:/tmp/errorlist.xml /tmp/example.xml .PHONY: validateXMLV2 -validateXMLV2: /tmp/errorlist.xml - xmllint --noout --relaxng xmlV2.rng $< - +validateXMLV2: createXMLExamples + xmllint --noout --relaxng xmlV2.rng /tmp/errorlist.xml + xmllint --noout --relaxng xmlV2.rng /tmp/example.xml ###### Build diff --git a/tools/dmake.cpp b/tools/dmake.cpp index cf92a3d4b..b749e484e 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -417,9 +417,13 @@ int main(int argc, char **argv) fout << "# Validate XML output (to detect regressions)\n"; fout << "/tmp/errorlist.xml: cppcheck\n"; fout << "\tcppcheck --errorlist >$@\n"; + fout << "/tmp/example.xml: cppcheck\n"; + fout << "\tcppcheck --xml --inconclusive -j 4 cli externals gui lib test 2>/tmp/example.xml\n"; + fout << "createXMLExamples:/tmp/errorlist.xml /tmp/example.xml\n"; fout << ".PHONY: validateXMLV2\n"; - fout << "validateXMLV2: /tmp/errorlist.xml\n"; - fout << "\txmllint --noout --relaxng xmlV2.rng $<\n\n"; + fout << "validateXMLV2: createXMLExamples\n"; + fout << "\txmllint --noout --relaxng xmlV2.rng /tmp/errorlist.xml\n"; + fout << "\txmllint --noout --relaxng xmlV2.rng /tmp/example.xml\n"; fout << "\n###### Build\n\n"; diff --git a/xmlV2.rng b/xmlV2.rng old mode 100644 new mode 100755 index 235eb54fc..967c18e7b --- a/xmlV2.rng +++ b/xmlV2.rng @@ -1,50 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +