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

Improved iar and MS Visual Studio message detection

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • warnings-plugin
    • None
    • Jenkins

    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

          tspedersen Torben Pedersen created issue -
          drulli Ulli Hafner made changes -
          Field Original Value New Value
          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 );
          The following error from MS Visual Studio is not found by the Warnings plugin
          {noformat}
          ..\\..\\..\\xx_Source\\file.c(54): fatal error c1083: cannot open include file: 'Header.h': No such file or directory
          {noformat}
          I've made a reg ex that finds it, fell free to use/modify
          {code}
          "^\\s*(.+)\\((\\d+)\\)\\s*:\\s*([\\w\\s]+\\d+)\\s*:\\s*(.+)$"
          {code}

          The following linker error from IAR Embedded Workbench 3.60 is not found by the Warnings plugin
          {noformat}
          Error[e46]: Undefined external "xxx" referred in Source ( c:\Projects\.....\Source.r85 )
          {noformat}
          I've made a reg ex that finds it, fell free to use/modify
          {code}
          "^\\s*(\\w+\\[\\w\\d+\\]):\\s*(.*)\\s*\\(\\s*(.*)\\)$"
          {code}

          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:
          {code}
          ^\s*([a-zA-Z]:\\..+)\s+(\d+)\s+(.+):\s+(.*)
          {code}
          and using this code:
          {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 );
          {code}
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 140760 ] JNJira + In-Review [ 189239 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: