cppcheck plugin will not fail build if more than one severity.evaluation is checked

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major
    • Component/s: cppcheck-plugin
    • Environment:
      I'm running Jenkins 1.443 on a 64 bit CentOS 5.5 machine.

      I want to run the cppcheck plugin in a manner that will evaluate the sum of errors and warnings to determine if my build should become unstable or fail. I have my severity.evaluation (note that this is misspelled on the gui as 'severiry.evaluation') configured with both severity 'error' and severity 'warning' checked. I also have my 'Build Status' thresholds set to '0' as I want any error or warning to fail the build. I had a build with an error in it and my build did not fail. I've worked this issue into a small test project and saw the same results.

      Here is the console output for a project with severity evaluation configured to consider both errors and warnings and the build status thresholds set to '0', and a cppcheck.xml file with a single error:

      Started by user anonymous
      Building on master
      [workspace] $ /bin/bash -xe /tmp/hudson127869.sh
      + touch regtestout.xml
      + touch junit.xml
      [Cppcheck] Starting the cppcheck analysis.
      [Cppcheck] Processing 1 files with the pattern 'cppcheck.xml'.
      [Cppcheck] [WARNING] - The source file 'file:/var/hudson/workspace/drra-mysql-32/drra/src/RecTemplate.cpp' doesn't exist on the slave. The ability to display its source code has been removed.
      [Cppcheck] Not changing build status, since no threshold has been exceeded
      [Cppcheck] Ending the cppcheck analysis.
      Finished: SUCCESS

      Here is the console output of the same project ran with severity evaluation configured to consider just errors (no longer warnings) and the build status thresholds set to '0', and a cppcheck.xml file with a single error:

      Started by user anonymous
      Building on master
      [workspace] $ /bin/bash -xe /tmp/hudson127860.sh
      + touch regtestout.xml
      + touch junit.xml
      [Cppcheck] Starting the cppcheck analysis.
      [Cppcheck] Processing 1 files with the pattern 'cppcheck.xml'.
      [Cppcheck] [WARNING] - The source file 'file:/var/hudson/workspace/drra-mysql-32/drra/src/RecTemplate.cpp' doesn't exist on the slave. The ability to display its source code has been removed.
      [Cppcheck] Setting build status to FAILURE since total number of errors (severity 'error') exceeds the threshold value ;0'.
      [Cppcheck] Ending the cppcheck analysis.
      Build step 'Publish Cppcheck results' changed build result to FAILURE
      Finished: FAILURE

      So it appears as though the only way to get the cppcheck plugin to fail a build is if the severity is only evaluated for a single severity level. If multiple severity levels are configured the build will not fail.

            Assignee:
            Gregory Boissinot
            Reporter:
            brianii
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: