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

Improved iar and MS Visual Studio message detection

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • 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

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/parser/MsBuildParser.java
          src/test/java/hudson/plugins/warnings/parser/MsBuildParserTest.java
          src/test/resources/hudson/plugins/warnings/parser/issue10566.txt
          http://jenkins-ci.org/commit/warnings-plugin/abbe9d03928612e42f3660bc771ac9c7cd9a202f
          Log:
          [FIXED JENKINS-10566] Improved MS Build warning detection.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/parser/MsBuildParser.java src/test/java/hudson/plugins/warnings/parser/MsBuildParserTest.java src/test/resources/hudson/plugins/warnings/parser/issue10566.txt http://jenkins-ci.org/commit/warnings-plugin/abbe9d03928612e42f3660bc771ac9c7cd9a202f Log: [FIXED JENKINS-10566] Improved MS Build warning detection.
          Hide
          drulli Ulli Hafner added a comment -

          The IAR fix is not included since this will break the current unit tests. Any idea?

          Show
          drulli Ulli Hafner added a comment - The IAR fix is not included since this will break the current unit tests. Any idea?
          Hide
          tspedersen Torben Pedersen added a comment -

          I'm sorry for asking, but I dont have enough knowledge about the unit test, to know what and how. Can you give me an error message, otherwise I'll have to look into it, but I haven't time at the moment to dig into the code and unit. In a month or two, I’ll look into it

          Show
          tspedersen Torben Pedersen added a comment - I'm sorry for asking, but I dont have enough knowledge about the unit test, to know what and how. Can you give me an error message, otherwise I'll have to look into it, but I haven't time at the moment to dig into the code and unit. In a month or two, I’ll look into it
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_warnings #145

          Show
          dogfood dogfood added a comment - Integrated in plugins_warnings #145

            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: