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

Improved iar and MS Visual Studio message detection

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: warnings-plugin
    • Labels:
      None
    • Environment:
      Jenkins
    • Similar Issues:

      Description

      The following error from MS Visual Studio is not found by the Warnings plugin

      ..\\..\\..\\xx_Source\\file.c(54): fatal error c1083: cannot open include file: 'Header.h': No such file or directory 
      

      I've made a reg ex that finds it, fell free to use/modify

      "^\\s*(.+)\\((\\d+)\\)\\s*:\\s*([\\w\\s]+\\d+)\\s*:\\s*(.+)$"
      

      The following linker error from IAR Embedded Workbench 3.60 is not found by the Warnings plugin

      Error[e46]: Undefined external "xxx" referred in Source ( c:\Projects\.....\Source.r85 )
      

      I've made a reg ex that finds it, fell free to use/modify

      "^\\s*(\\w+\\[\\w\\d+\\]):\\s*(.*)\\s*\\(\\s*(.*)\\)$"
      

      Also, I've made a new reg ex. for PC-lint. The PC_Lint and MS visual studio created the same output, so it was detected twice...
      I'm using PC-lint with this setup:
      -width(0) // don't insert line breaks (unlimited output width).
      +ffn
      -hf1 // message height one
      -"format=%f %l %t %n: %m"
      reg ex:

      ^\s*([a-zA-Z]:\\..+)\s+(\d+)\s+(.+):\s+(.*)
      

      and using this code:

      import hudson.plugins.warnings.parser.Warning
      import hudson.plugins.analysis.util.model.Priority;
      
      String fileName = matcher.group(1)
      String lineNumber = matcher.group(2)
      String category = matcher.group(3)
      String message = matcher.group(4)
      Priority priority = Priority.HIGH;
      
             if (category.startsWith("Info" )) {
                  priority = Priority.LOW;
              }
          
             if (category.startsWith("Warning")) {
                  priority = Priority.NORMAL;
              }
             if (category.startsWith("Error")) {
                  priority = Priority.HIGH;
              }
      
      return new Warning(fileName, Integer.parseInt(lineNumber), "PC-LINT", category, message, priority );
      

        Attachments

          Activity

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              tspedersen Torben Pedersen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: