Home | History | Annotate | Download | only in res
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2008 The Android Open Source Project
      3 
      4     Licensed under the Apache License, Version 2.0 (the "License");
      5     you may not use this file except in compliance with the License.
      6     You may obtain a copy of the License at
      7 
      8         http://www.apache.org/licenses/LICENSE-2.0
      9 
     10     Unless required by applicable law or agreed to in writing, software
     11     distributed under the License is distributed on an "AS IS" BASIS,
     12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13     See the License for the specific language governing permissions and
     14     limitations under the License.
     15 -->
     16 
     17 <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
     18 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     19     <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
     20 
     21     <xsl:template match="/">
     22 
     23         <html>
     24             <STYLE type="text/css">
     25                 @import "cts_result.css";
     26             </STYLE>
     27 
     28             <body>
     29                 <!-- Title of the Report -->
     30                 <DIV id="title">
     31                     <TABLE>
     32                         <TR>
     33                             <TD width="40%" align="left"><img src="logo.gif"></img></TD>
     34                             <TD width="60%" align="left">
     35                                 <h1>Test Report for <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_model"/> -
     36                                     <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
     37                                 </h1>
     38                             </TD>
     39                         </TR>
     40                     </TABLE>
     41                 </DIV>
     42                 <img src="newrule-green.png" align="left"></img>
     43 
     44                 <br></br>
     45                 <br></br>
     46 
     47                 <!-- Header with phone and plan information -->
     48                 <DIV id="summary">
     49                     <TABLE width="90%" frame="none">
     50                         <TR>
     51                             <TH>Device Information</TH>
     52                             <TH>Test Summary</TH>
     53                         </TR>
     54 
     55                         <TR>
     56                             <TD>
     57                                 <!-- Device information -->
     58                                 <div id="summaryinfo">
     59                                     <TABLE width="75%">
     60                                         <TR>
     61                                             <TD class="rowtitle">Build Model</TD>
     62                                             <TD>
     63                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_model"/>
     64                                             </TD>
     65                                         </TR>
     66                                         <TR>
     67                                             <TD class="rowtitle">Build Name</TD>
     68                                             <TD>
     69                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildName"/>
     70                                             </TD>
     71                                         </TR>
     72                                         <TR>
     73                                             <TD class="rowtitle">Build Brand</TD>
     74                                             <TD>
     75                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_brand"/>
     76                                             </TD>
     77                                         </TR>
     78                                         <TR>
     79                                             <TD class="rowtitle">Build Manufacturer</TD>
     80                                             <TD>
     81                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_manufacturer"/>
     82                                             </TD>
     83                                         </TR>
     84                                         <TR>
     85                                             <TD class="rowtitle">Device ID</TD>
     86                                             <TD>
     87                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
     88                                             </TD>
     89                                         </TR>
     90                                         <TR>
     91                                             <TD class="rowtitle">Firmware Version</TD>
     92                                             <TD>
     93                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildVersion"/>
     94                                             </TD>
     95                                         </TR>
     96                                         <TR>
     97                                             <TD class="rowtitle">Firmware Build Number</TD>
     98                                             <TD>
     99                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildID"/>
    100                                             </TD>
    101                                         </TR>
    102                                         <TR>
    103                                             <TD class="rowtitle">Build Fingerprint</TD>
    104                                             <TD>
    105                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_fingerprint"/>
    106                                             </TD>
    107                                         </TR>
    108                                         <TR>
    109                                             <TD class="rowtitle">Build ABI</TD>
    110                                             <TD>
    111                                                 <xsl:value-of
    112                                                   select="TestResult/DeviceInfo/BuildInfo/@build_abi"/>
    113                                             </TD>
    114                                         </TR>
    115                                         <TR>
    116                                             <TD class="rowtitle">Build ABI2</TD>
    117                                             <TD>
    118                                                 <xsl:value-of
    119                                                   select="TestResult/DeviceInfo/BuildInfo/@build_abi2"/>
    120                                             </TD>
    121                                         </TR>
    122                                         <TR>
    123                                             <TD class="rowtitle">Android Platform Version</TD>
    124                                             <TD>
    125                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@androidPlatformVersion"/>
    126                                             </TD>
    127                                         </TR>
    128                                         <TR>
    129                                             <TD class="rowtitle">Supported Locales</TD>
    130                                             <TD>
    131                                                 <xsl:call-template name="formatDelimitedString">
    132                                                     <xsl:with-param name="string" select="TestResult/DeviceInfo/BuildInfo/@locales"/>
    133                                                 </xsl:call-template>
    134                                             </TD>
    135                                         </TR>
    136                                         <TR>
    137                                             <TD class="rowtitle">Screen Size</TD>
    138                                             <TD>
    139                                                 <xsl:value-of select="TestResult/DeviceInfo/Screen/@screen_size"/>
    140                                             </TD>
    141                                         </TR>
    142                                         <TR>
    143                                             <TD class="rowtitle">Resolution</TD>
    144                                             <TD>
    145                                                 <xsl:value-of select="TestResult/DeviceInfo/Screen/@resolution"/>
    146                                             </TD>
    147                                         </TR>
    148                                         <TR>
    149                                             <TD class="rowtitle">Density</TD>
    150                                             <TD>
    151                                                 <xsl:value-of select="TestResult/DeviceInfo/Screen/@screen_density"/>
    152                                                 (<xsl:value-of select="TestResult/DeviceInfo/Screen/@screen_density_bucket"/>)
    153                                             </TD>
    154                                         </TR>
    155                                         <TR>
    156                                             <TD class="rowtitle">Phone number</TD>
    157                                             <TD>
    158                                                 <xsl:value-of select="TestResult/DeviceInfo/PhoneSubInfo/@subscriberId"/>
    159                                             </TD>
    160                                         </TR>
    161                                         <TR>
    162                                             <TD class="rowtitle">X dpi</TD>
    163                                             <TD>
    164                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Xdpi"/>
    165                                             </TD>
    166                                         </TR>
    167                                         <TR>
    168                                             <TD class="rowtitle">Y dpi</TD>
    169                                             <TD>
    170                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Ydpi"/>
    171                                             </TD>
    172                                         </TR>
    173                                         <TR>
    174                                             <TD class="rowtitle">Touch</TD>
    175                                             <TD>
    176                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@touch"/>
    177                                             </TD>
    178                                         </TR>
    179                                         <TR>
    180                                             <TD class="rowtitle">Navigation</TD>
    181                                             <TD>
    182                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@navigation"/>
    183                                             </TD>
    184                                         </TR>
    185                                         <TR>
    186                                             <TD class="rowtitle">Keypad</TD>
    187                                             <TD>
    188                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@keypad"/>
    189                                             </TD>
    190                                         </TR>
    191                                         <TR>
    192                                             <TD class="rowtitle">Network</TD>
    193                                             <TD>
    194                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@network"/>
    195                                             </TD>
    196                                         </TR>
    197                                         <TR>
    198                                             <TD class="rowtitle">IMEI</TD>
    199                                             <TD>
    200                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imei"/>
    201                                             </TD>
    202                                         </TR>
    203                                         <TR>
    204                                             <TD class="rowtitle">IMSI</TD>
    205                                             <TD>
    206                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imsi"/>
    207                                             </TD>
    208                                         </TR>
    209                                         <TR>
    210                                             <TD class="rowtitle">Open GL ES Version</TD>
    211                                             <TD>
    212                                                 <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@openGlEsVersion"/>
    213                                             </TD>
    214                                         </TR>
    215                                         <TR>
    216                                             <TD class="rowtitle">Features</TD>
    217                                             <TD>
    218                                                 <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='sdk']">
    219                                                     <xsl:text>[</xsl:text>
    220                                                     <xsl:choose>
    221                                                         <xsl:when test="@available = 'true'">
    222                                                             <xsl:text>X</xsl:text>
    223                                                         </xsl:when>
    224                                                         <xsl:otherwise>
    225                                                             <xsl:text>_</xsl:text>
    226                                                         </xsl:otherwise>
    227                                                     </xsl:choose>
    228                                                     <xsl:text>] </xsl:text>
    229 
    230                                                     <xsl:value-of select="@name" />
    231                                                     <br />
    232                                                 </xsl:for-each>
    233                                             </TD>
    234                                         </TR>
    235                                         <TR>
    236                                             <TD class="rowtitle">Other Features</TD>
    237                                             <TD>
    238                                                 <UL>
    239                                                     <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='other']">
    240                                                         <LI><xsl:value-of select="@name" /></LI>
    241                                                     </xsl:for-each>
    242                                                 </UL>
    243                                             </TD>
    244                                         </TR>
    245                                         <TR>
    246                                             <TD class="rowtitle">Root Processes</TD>
    247                                             <TD>
    248                                                 <UL>
    249                                                     <xsl:for-each select="TestResult/DeviceInfo/ProcessInfo/Process[@uid='0']">
    250                                                         <LI><xsl:value-of select="@name" /></LI>
    251                                                     </xsl:for-each>
    252                                                 </UL>
    253                                             </TD>
    254                                         </TR>
    255                                         <TR>
    256                                             <TD class="rowtitle">Partitions</TD>
    257                                             <TD>
    258                                                 <UL>
    259                                                     <pre>
    260                                                         <xsl:call-template name="formatDelimitedString">
    261                                                             <xsl:with-param name="string" select="TestResult/DeviceInfo/BuildInfo/@partitions" />
    262                                                             <xsl:with-param name="numTokensPerRow" select="1" />
    263                                                         </xsl:call-template>
    264                                                     </pre>
    265                                                 </UL>
    266                                             </TD>
    267                                         </TR>
    268                                     </TABLE>
    269                                 </div>
    270                             </TD>
    271 
    272                             <!-- plan information -->
    273                             <TD>
    274                                 <div id="summaryinfo">
    275                                     <TABLE width="75%">
    276                                         <TR>
    277                                             <TD class="rowtitle">CTS version</TD>
    278                                             <TD>
    279                                                 <xsl:value-of select="TestResult/HostInfo/Cts/@version"/>
    280                                             </TD>
    281                                         </TR>
    282                                         <TR>
    283                                             <TD class="rowtitle">Test timeout</TD>
    284                                             <TD>
    285                                                 <xsl:value-of select="TestResult/HostInfo/Cts/IntValue[@name='testStatusTimeoutMs']/@value" /> ms
    286                                             </TD>
    287                                         </TR>
    288                                         <TR>
    289                                             <TD class="rowtitle">Host Info</TD>
    290                                             <TD>
    291                                                 <xsl:value-of select="TestResult/HostInfo/@name"/>
    292                                                 (<xsl:value-of select="TestResult/HostInfo/Os/@name"/> - 
    293                                                   <xsl:value-of select="TestResult/HostInfo/Os/@version"/>)
    294                                             </TD>
    295                                         </TR>
    296                                         <TR><TD><BR></BR></TD><TD></TD></TR>
    297                                         <TR>
    298                                             <TD class="rowtitle">Plan name</TD>
    299                                             <TD>
    300                                                 <xsl:value-of select="TestResult/@testPlan"/>
    301                                             </TD>
    302                                         </TR>
    303                                         <TR>
    304                                             <TD class="rowtitle">Start time</TD>
    305                                             <TD>
    306                                                 <xsl:value-of select="TestResult/@starttime"/>
    307                                             </TD>
    308                                         </TR>
    309                                         <TR>
    310                                             <TD class="rowtitle">End time</TD>
    311                                             <TD>
    312                                                 <xsl:value-of select="TestResult/@endtime"/>
    313                                             </TD>
    314                                         </TR>
    315 
    316                                         <!-- Test Summary -->
    317                                         <TR><TD><BR></BR></TD><TD></TD></TR>
    318                                         <TR>
    319                                             <TD class="rowtitle">Tests Passed</TD>
    320                                             <TD>
    321                                                 <xsl:value-of select="TestResult/Summary/@pass"/>
    322                                             </TD>
    323                                         </TR>
    324                                         <TR>
    325                                             <TD class="rowtitle">Tests Failed</TD>
    326                                             <TD>
    327                                                 <xsl:value-of select="TestResult/Summary/@failed"/>
    328                                             </TD>
    329                                         </TR>
    330                                         <TR>
    331                                             <TD class="rowtitle">Tests Timed out</TD>
    332                                             <TD>
    333                                                 <xsl:value-of select="TestResult/Summary/@timeout"/>
    334                                             </TD>
    335                                         </TR>
    336                                         <TR>
    337                                             <TD class="rowtitle">Tests Not Executed</TD>
    338                                             <TD>
    339                                                 <xsl:value-of select="TestResult/Summary/@notExecuted"/>
    340                                             </TD>
    341                                         </TR>
    342                                     </TABLE>
    343                                 </div>
    344                             </TD>
    345                         </TR>
    346                     </TABLE>
    347                 </DIV>
    348 
    349                 <!-- High level summary of test execution -->
    350                 <h2 align="center">Test Summary by Package</h2>
    351                 <DIV id="testsummary">
    352                     <TABLE>
    353                         <TR>
    354                             <TH>Test Package</TH>
    355                             <TH>Passed</TH>
    356                             <TH>Failed</TH>
    357                             <TH>Timed Out</TH>
    358                             <TH>Not Executed</TH>
    359                             <TH>Total Tests</TH>
    360                         </TR>
    361                         <xsl:for-each select="TestResult/TestPackage">
    362                             <TR>
    363                                 <TD>
    364                                     <xsl:variable name="href"><xsl:value-of select="@appPackageName"/></xsl:variable>
    365                                     <a href="#{$href}"><xsl:value-of select="@appPackageName"/></a>
    366                                 </TD>
    367                                 <TD>
    368                                     <xsl:value-of select="count(TestSuite//Test[@result = 'pass'])"/>
    369                                 </TD>
    370                                 <TD>
    371                                     <xsl:value-of select="count(TestSuite//Test[@result = 'fail'])"/>
    372                                 </TD>
    373                                 <TD>
    374                                     <xsl:value-of select="count(TestSuite//Test[@result = 'timeout'])"/>
    375                                 </TD>
    376                                 <TD>
    377                                     <xsl:value-of select="count(TestSuite//Test[@result = 'notExecuted'])"/>
    378                                 </TD>
    379                                 <TD>
    380                                     <xsl:value-of select="count(TestSuite//Test)"/>
    381                                 </TD>
    382                             </TR>
    383                         </xsl:for-each> <!-- end package -->
    384                     </TABLE>
    385                 </DIV>
    386 
    387                 <xsl:call-template name="filteredResultTestReport">
    388                     <xsl:with-param name="header" select="'Test Failures'" />
    389                     <xsl:with-param name="resultFilter" select="'fail'" />
    390                 </xsl:call-template>
    391 
    392                 <xsl:call-template name="filteredResultTestReport">
    393                     <xsl:with-param name="header" select="'Test Timeouts'" />
    394                     <xsl:with-param name="resultFilter" select="'timeout'" />
    395                 </xsl:call-template>
    396 
    397                 <h2 align="center">Detailed Test Report</h2>
    398                 <xsl:call-template name="detailedTestReport" />
    399 
    400             </body>
    401         </html>
    402     </xsl:template>
    403 
    404     <xsl:template name="filteredResultTestReport">
    405         <xsl:param name="header" />
    406         <xsl:param name="resultFilter" />
    407         <xsl:variable name="numMatching" select="count(TestResult/TestPackage/TestSuite//TestCase/Test[@result=$resultFilter])" />
    408         <xsl:if test="$numMatching &gt; 0">
    409             <h2 align="center"><xsl:value-of select="$header" /> (<xsl:value-of select="$numMatching"/>)</h2>
    410             <xsl:call-template name="detailedTestReport">
    411                 <xsl:with-param name="resultFilter" select="$resultFilter"/>
    412             </xsl:call-template>
    413         </xsl:if>
    414     </xsl:template>
    415 
    416     <xsl:template name="detailedTestReport">
    417         <xsl:param name="resultFilter" />
    418         <DIV id="testdetail">
    419             <xsl:for-each select="TestResult/TestPackage">
    420                 <xsl:if test="$resultFilter=''
    421                         or count(TestSuite//TestCase/Test[@result=$resultFilter]) &gt; 0">
    422                     <DIV id="none">
    423                         <TABLE>
    424                             <TR>
    425                                 <TD class="none" align="left">
    426                                     <xsl:variable name="href"><xsl:value-of select="@appPackageName"/></xsl:variable>
    427                                     <a name="{$href}">Compatibility Test Package: <xsl:value-of select="@appPackageName"/></a>
    428                                 </TD>
    429                             </TR>
    430                         </TABLE>
    431                     </DIV>
    432 
    433                     <TABLE>
    434                         <TR>
    435                             <TH width="25%">Test</TH>
    436                             <TH width="7%">Result</TH>
    437                             <TH width="68%">Failure Details</TH>
    438                         </TR>
    439 
    440                         <!-- test case -->
    441                         <xsl:for-each select="TestSuite//TestCase">
    442 
    443                             <xsl:if test="$resultFilter='' or count(Test[@result=$resultFilter]) &gt; 0">
    444                                 <!-- emit a blank row before every test suite name -->
    445                                 <xsl:if test="position()!=1">
    446                                     <TR><TD class="testcasespacer" colspan="3"></TD></TR>
    447                                 </xsl:if>
    448 
    449                                 <TR>
    450                                     <TD class="testcase" colspan="3">
    451                                         <xsl:for-each select="ancestor::TestSuite">
    452                                             <xsl:if test="position()!=1">.</xsl:if>
    453                                             <xsl:value-of select="@name"/>
    454                                         </xsl:for-each>
    455                                         <xsl:text>.</xsl:text>
    456                                         <xsl:value-of select="@name"/>
    457                                     </TD>
    458                                 </TR>
    459                             </xsl:if>
    460 
    461                             <!-- test -->
    462                             <xsl:for-each select="Test">
    463                                 <xsl:if test="$resultFilter='' or $resultFilter=@result">
    464                                     <TR>
    465                                         <TD class="testname"> -- <xsl:value-of select="@name"/></TD>
    466 
    467                                         <!-- test results -->
    468                                         <xsl:choose>
    469                                             <xsl:when test="string(@KnownFailure)">
    470                                                 <!-- "pass" indicates the that test actually passed (results have been inverted already) -->
    471                                                 <xsl:if test="@result='pass'">
    472                                                     <TD class="pass">
    473                                                         <div style="text-align: center; margin-left:auto; margin-right:auto;">
    474                                                             known problem
    475                                                         </div>
    476                                                     </TD>
    477                                                     <TD class="failuredetails"></TD>
    478                                                 </xsl:if>
    479 
    480                                                 <!-- "fail" indicates that a known failure actually passed (results have been inverted already) -->
    481                                                 <xsl:if test="@result='fail'">
    482                                                     <TD class="failed">
    483                                                         <div style="text-align: center; margin-left:auto; margin-right:auto;">
    484                                                             <xsl:value-of select="@result"/>
    485                                                         </div>
    486                                                     </TD>
    487                                                    <TD class="failuredetails">
    488                                                         <div id="details">
    489                                                             A test that was a known failure actually passed. Please check.
    490                                                         </div>
    491                                                    </TD>
    492                                                 </xsl:if>
    493                                             </xsl:when>
    494 
    495                                             <xsl:otherwise>
    496                                                 <xsl:if test="@result='pass'">
    497                                                     <TD class="pass">
    498                                                         <div style="text-align: center; margin-left:auto; margin-right:auto;">
    499                                                             <xsl:value-of select="@result"/>
    500                                                         </div>
    501                                                     </TD>
    502                                                     <TD class="failuredetails"></TD>
    503                                                 </xsl:if>
    504 
    505                                                 <xsl:if test="@result='fail'">
    506                                                     <TD class="failed">
    507                                                         <div style="text-align: center; margin-left:auto; margin-right:auto;">
    508                                                             <xsl:value-of select="@result"/>
    509                                                         </div>
    510                                                     </TD>
    511                                                     <TD class="failuredetails">
    512                                                         <div id="details">
    513                                                             <xsl:value-of select="FailedScene/@message"/>
    514                                                         </div>
    515                                                     </TD>
    516                                                 </xsl:if>
    517 
    518                                                 <xsl:if test="@result='timeout'">
    519                                                     <TD class="timeout">
    520                                                         <div style="text-align: center; margin-left:auto; margin-right:auto;">
    521                                                             <xsl:value-of select="@result"/>
    522                                                         </div>
    523                                                     <TD class="failuredetails"></TD>
    524                                                     </TD>
    525                                                 </xsl:if>
    526 
    527                                                 <xsl:if test="@result='notExecuted'">
    528                                                     <TD class="notExecuted">
    529                                                         <div style="text-align: center; margin-left:auto; margin-right:auto;">
    530                                                             <xsl:value-of select="@result"/>
    531                                                         </div>
    532                                                     </TD>
    533                                                     <TD class="failuredetails"></TD>
    534                                                 </xsl:if>
    535                                             </xsl:otherwise>
    536                                         </xsl:choose>
    537                                     </TR> <!-- finished with a row -->
    538                                 </xsl:if>
    539                             </xsl:for-each> <!-- end test -->
    540                         </xsl:for-each> <!-- end test case -->
    541                     </TABLE>
    542                 </xsl:if>
    543             </xsl:for-each> <!-- end test package -->
    544         </DIV>
    545     </xsl:template>
    546 
    547     <!-- Take a delimited string and insert line breaks after a some number of elements. --> 
    548     <xsl:template name="formatDelimitedString">
    549         <xsl:param name="string" />
    550         <xsl:param name="numTokensPerRow" select="10" />
    551         <xsl:param name="tokenIndex" select="1" />
    552         <xsl:if test="$string">
    553             <!-- Requires the last element to also have a delimiter after it. -->
    554             <xsl:variable name="token" select="substring-before($string, ';')" />
    555             <xsl:value-of select="$token" />
    556             <xsl:text>&#160;</xsl:text>
    557           
    558             <xsl:if test="$tokenIndex mod $numTokensPerRow = 0">
    559                 <br />
    560             </xsl:if>
    561 
    562             <xsl:call-template name="formatDelimitedString">
    563                 <xsl:with-param name="string" select="substring-after($string, ';')" />
    564                 <xsl:with-param name="numTokensPerRow" select="$numTokensPerRow" />
    565                 <xsl:with-param name="tokenIndex" select="$tokenIndex + 1" />
    566             </xsl:call-template>
    567         </xsl:if>
    568     </xsl:template>
    569 
    570 </xsl:stylesheet>
    571