Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-67085

[CPPCheck] [-ERROR-] Skipping file 'cppcheck.xml' because it's empty

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • warnings-ng-plugin
    • None
    • Ubuntu

      I am using Warnings Next Generation to run many tests against my code, one of which is CppCheck. Whether I specify a pattern or not in my jenkinsfile I get configuration errors.

      recordIssues tools: [gcc(), codeAnalysis(), cpd(), cppCheck(pattern: 'cppcheck.xml'), drMemory(), flawfinder(), infer(), pcLint()]

       

      What do I need to put into cppcheck.xml for this to work?

       

       

          [JENKINS-67085] [CPPCheck] [-ERROR-] Skipping file 'cppcheck.xml' because it's empty

          Ulli Hafner added a comment -

          Well, the error says that your file is empty. Is it empty? XML files are not allowed to be empty.

          Ulli Hafner added a comment - Well, the error says that your file is empty. Is it empty? XML files are not allowed to be empty.

          Michael Miner added a comment -

          I understand that, my issue is  I cannot find any documentation that tells me what I can put into this xml file. 

           

          So if I knew where to look for this information, I would. I looked, I came up emprty. 

          Michael Miner added a comment - I understand that, my issue is  I cannot find any documentation that tells me what I can put into this xml file.    So if I knew where to look for this information, I would. I looked, I came up emprty. 

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - How do you invoke https://cppcheck.sourceforge.io?

          Michael Miner added a comment -

          I do have a branch where CppCheck works using 
          sh label: '', returnStatus: true, script: 'cppcheck . --enable=all --inconclusive --xml --xml-version=2 graphal 2> cppcheck-result.xml' publishCppcheck allowNoReport: true, ignoreBlankFiles: true, pattern: '**/cppcheck-result.xml'
           

          The Warnings Next Generation plugin invokes it differently, I think using commands in the xml file. That is the documentation I am searching for. 

          Michael Miner added a comment - I do have a branch where CppCheck works using  sh label: '', returnStatus: true, script: 'cppcheck . --enable=all --inconclusive --xml --xml-version=2 graphal 2> cppcheck-result.xml' publishCppcheck allowNoReport: true, ignoreBlankFiles: true, pattern: '**/cppcheck-result.xml'   The Warnings Next Generation plugin invokes it differently, I think using commands in the xml file. That is the documentation I am searching for. 

          Ulli Hafner added a comment -

          The warnings plugin does not invoke cppcheck on its own. It just reads the results. So you need to call your shell script in your build before you invoke the warnings plugin.

          Ulli Hafner added a comment - The warnings plugin does not invoke cppcheck on its own. It just reads the results. So you need to call your shell script in your build before you invoke the warnings plugin.

          Michael Miner added a comment -

          Now that is what I did not understand. So this Warnings Next Generation only aggregates the data. I thought it ran the tests and presented the results! Thank you for clearing that up!

           

          Michael Miner added a comment - Now that is what I did not understand. So this Warnings Next Generation only aggregates the data. I thought it ran the tests and presented the results! Thank you for clearing that up!  

          Michael Miner added a comment -

          This was a major misunderstanding on my part. 

          Michael Miner added a comment - This was a major misunderstanding on my part. 

            drulli Ulli Hafner
            michaelbminer Michael Miner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: