Title: [40714] trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src: Fix for Gnatcheck

Diff

Modified: trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/java/com/thalesgroup/dtkit/tusar/Gnatcheck.java (40713 => 40714)


--- trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/java/com/thalesgroup/dtkit/tusar/Gnatcheck.java	2012-09-29 13:10:47 UTC (rev 40713)
+++ trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/java/com/thalesgroup/dtkit/tusar/Gnatcheck.java	2012-09-29 19:01:27 UTC (rev 40714)
@@ -96,7 +96,7 @@
      */
     @Override
     public boolean validateOutputFile(File inputXMLFile) throws ValidationException {
-        List<ValidationError> errors = TusarModel.OUTPUT_TUSAR_3_0.validate(inputXMLFile);
+        List<ValidationError> errors = TusarModel.OUTPUT_TUSAR_10_0.validate(inputXMLFile);
         this.setOutputValidationErrors(errors);
         return errors.isEmpty();
     }

Modified: trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/java/com/thalesgroup/dtkit/tusar/GnatcheckParser.java (40713 => 40714)


--- trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/java/com/thalesgroup/dtkit/tusar/GnatcheckParser.java	2012-09-29 13:10:47 UTC (rev 40713)
+++ trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/java/com/thalesgroup/dtkit/tusar/GnatcheckParser.java	2012-09-29 19:01:27 UTC (rev 40714)
@@ -71,9 +71,9 @@
     private String str_filehead =
             "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tusar:tusar xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n" +
                     "             xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
-                    "             xmlns:violations=\"http://www.thalesgroup.com/tusar/violations/v3\"\n" +
-                    "             xmlns:tusar=\"http://www.thalesgroup.com/tusar/v3\"\n" +
-                    "             version=\"3.0\">\n" +
+                    "             xmlns:violations=\"http://www.thalesgroup.com/tusar/violations/v4\"\n" +
+                    "             xmlns:tusar=\"http://www.thalesgroup.com/tusar/v10\"\n" +
+                    "             version=\"10.0\">\n" +
                     "    <tusar:violations>\n";
 
     private String str_filetail =
@@ -289,4 +289,4 @@
         return bMatch;
     }
 
-}
\ No newline at end of file
+}

Modified: trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/resources/com/thalesgroup/dtkit/tusar/cppcheck-1.0-to-tusar-5.0.xsl (40713 => 40714)


--- trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/resources/com/thalesgroup/dtkit/tusar/cppcheck-1.0-to-tusar-5.0.xsl	2012-09-29 13:10:47 UTC (rev 40713)
+++ trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/main/resources/com/thalesgroup/dtkit/tusar/cppcheck-1.0-to-tusar-5.0.xsl	2012-09-29 19:01:27 UTC (rev 40714)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 /*******************************************************************************
-* Copyright (c) 2011 Thales Corporate Services SAS                             *
-* Author : Gregory Boissinot                                                   *
+* Copyright (c) 2012 Thales Corporate Services SAS                             *
+* Author : Gregory Boissinot, Julien Dort, Aravindan Mahendran                 *
 *                                                                              *
 * Permission is hereby granted, free of charge, to any person obtaining a copy *
 * of this software and associated documentation files (the "Software"), to deal*
@@ -39,41 +39,88 @@
             <xsl:element name="tusar:violations">
 
                 <xsl:attribute name="toolname">cppcheck</xsl:attribute>
-                <xsl:attribute name="version">1.43</xsl:attribute>
+                
+                <xsl:choose>
+                    <xsl:when test="@version=2">
+                        <xsl:attribute name="version">
+                            <xsl:value-of select="cppcheck/@version"/>
+                        </xsl:attribute>
+                        <xsl:apply-templates select="errors"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:attribute name="version">1.43</xsl:attribute>
+                        <xsl:for-each-group select="error" group-by="@file">
 
-                <xsl:for-each-group select="error" group-by="@file">
+                            <xsl:element name="violations:file">
+                                <xsl:attribute name="path">
+                                    <xsl:value-of select="@file"/>
+                                </xsl:attribute>
 
-                    <xsl:element name="violations:file">
-                        <xsl:attribute name="path">
-                            <xsl:value-of select="@file"/>
-                        </xsl:attribute>
+                                <xsl:for-each select="current-group()">
 
-                        <xsl:for-each select="current-group()">
+                                    <xsl:element name="violations:violation">
+                                        <xsl:attribute name="line">
+                                            <xsl:value-of select="@line"/>
+                                        </xsl:attribute>
 
-                            <xsl:element name="violations:violation">
-                                <xsl:attribute name="line">
-                                    <xsl:value-of select="@line"/>
-                                </xsl:attribute>
+                                        <xsl:attribute name="message">
+                                            <xsl:value-of select="@msg"/>
+                                        </xsl:attribute>
 
-                                <xsl:attribute name="message">
-                                    <xsl:value-of select="@msg"/>
-                                </xsl:attribute>
+                                        <xsl:attribute name="key">
+                                            <xsl:value-of select="@id"/>
+                                        </xsl:attribute>
 
-                                <xsl:attribute name="key">
-                                    <xsl:value-of select="@id"/>
-                                </xsl:attribute>
+                                        <xsl:attribute name="severity">
+                                            <xsl:value-of select="@severity"/>
+                                        </xsl:attribute>
 
-                                <xsl:attribute name="severity">
-                                    <xsl:value-of select="@severity"/>
-                                </xsl:attribute>
+                                    </xsl:element>
 
+                                </xsl:for-each>
                             </xsl:element>
 
-                        </xsl:for-each>
-                    </xsl:element>
-
-                </xsl:for-each-group>
+                        </xsl:for-each-group>
+                    </xsl:otherwise>
+                </xsl:choose>
             </xsl:element>
         </tusar:tusar>
     </xsl:template>
+    
+    <xsl:template match="errors">
+         <xsl:for-each-group select="error" group-by="location/@file">
+
+            <xsl:element name="violations:file">
+                <xsl:attribute name="path">
+                    <xsl:value-of select="location/@file"/>
+                </xsl:attribute>
+
+                    <xsl:for-each select="current-group()">
+                        <xsl:element name="violations:violation">
+                            <xsl:attribute name="line">
+                                <xsl:value-of select="location/@line"/>
+                            </xsl:attribute>
+
+                            <xsl:attribute name="message">
+                                <xsl:value-of select="@verbose"/>
+                            </xsl:attribute>
+
+                            <xsl:attribute name="key">
+                                <xsl:value-of select="@id"/>
+                            </xsl:attribute>
+
+                            <xsl:attribute name="severity">
+                                <xsl:value-of select="@severity"/>
+                            </xsl:attribute>
+
+                        </xsl:element>
+                    </xsl:for-each>
+
+            </xsl:element>
+            
+        </xsl:for-each-group>        
+    </xsl:template>
+    
+    
+    
 </xsl:stylesheet>
\ No newline at end of file

Modified: trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/test/resources/com/thalesgroup/dtkit/tusar/gnatcheck/testcase1/tusar-result.xml (40713 => 40714)


--- trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/test/resources/com/thalesgroup/dtkit/tusar/gnatcheck/testcase1/tusar-result.xml	2012-09-29 13:10:47 UTC (rev 40713)
+++ trunk/hudson/dtkit/dtkit-default/tusar-output/dtkit-default-tusar/src/test/resources/com/thalesgroup/dtkit/tusar/gnatcheck/testcase1/tusar-result.xml	2012-09-29 19:01:27 UTC (rev 40714)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <tusar:tusar xmlns:xs="http://www.w3.org/2001/XMLSchema"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-             xmlns:violations="http://www.thalesgroup.com/tusar/violations/v3"
-             xmlns:tusar="http://www.thalesgroup.com/tusar/v3"
-             version="3.0">
+             xmlns:violations="http://www.thalesgroup.com/tusar/violations/v4"
+             xmlns:tusar="http://www.thalesgroup.com/tusar/v10"
+             version="10.0">
     <tusar:violations>
         <violations:file path="chop.ads">
             <violations:violation line="4"
@@ -1314,4 +1314,4 @@
                                   severity="info"/>
         </violations:file>
     </tusar:violations>
-</tusar:tusar>
\ No newline at end of file
+</tusar:tusar>

Reply via email to