Sorin Marian Nasoi has proposed merging 
lp:~zorba-coders/zorba/update_fots_snaphot into lp:zorba.

Commit message:
- update FOTS snaphot to Feb 27th
- fixes in reporting module

Requested reviews:
  Sorin Marian Nasoi (sorin.marian.nasoi)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/update_fots_snaphot/+merge/150769

- update FOTS snaphot to Feb 27th
- fixes in reporting module
-- 
https://code.launchpad.net/~zorba-coders/zorba/update_fots_snaphot/+merge/150769
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'test/fots/CMakeLists.txt'
--- test/fots/CMakeLists.txt	2013-02-26 23:11:16 +0000
+++ test/fots/CMakeLists.txt	2013-02-27 11:57:38 +0000
@@ -892,6 +892,12 @@
 EXPECTED_FOTS_FAILURE (prod-WindowClause WindowingUseCase19S 0)
 EXPECTED_FOTS_FAILURE (prod-WindowClause SlidingWindowExpr507 0)
 EXPECTED_FOTS_FAILURE (prod-WindowClause TumblingWindowExpr507 0)
+EXPECTED_FOTS_FAILURE (xs-anyURI cbcl-anyURI-002 0)
+EXPECTED_FOTS_FAILURE (xs-anyURI cbcl-anyURI-004b 0)
+EXPECTED_FOTS_FAILURE (xs-anyURI cbcl-anyURI-006 0)
+EXPECTED_FOTS_FAILURE (xs-anyURI cbcl-anyURI-006b 0)
+EXPECTED_FOTS_FAILURE (xs-anyURI cbcl-anyURI-009b 0)
+EXPECTED_FOTS_FAILURE (xs-anyURI cbcl-anyURI-012b 0)
 EXPECTED_FOTS_FAILURE (xs-base64Binary base64-115 0)
 EXPECTED_FOTS_FAILURE (xs-normalizedString cbcl-normalizedstring-002 0)
 EXPECTED_FOTS_FAILURE (xs-normalizedString cbcl-normalizedstring-002b 0)

=== modified file 'test/fots/ImportFOTS.cmake'
--- test/fots/ImportFOTS.cmake	2013-02-22 10:56:59 +0000
+++ test/fots/ImportFOTS.cmake	2013-02-27 11:57:38 +0000
@@ -19,7 +19,7 @@
 
 
 # Change this to publish updated FOTS archives
-SET (FOTS_ARCHIVE "FOTS_030213.tgz")
+SET (FOTS_ARCHIVE "FOTS_270213.tgz")
 
 # Change this to modify which elements in FOTS driver results are output
 # as CDATA

=== modified file 'test/fots_driver/reporting.xq'
--- test/fots_driver/reporting.xq	2013-02-19 14:06:08 +0000
+++ test/fots_driver/reporting.xq	2013-02-27 11:57:38 +0000
@@ -93,7 +93,7 @@
 
       file:write("results.xml",
                  $results,
-                 $util:writeText);
+                 $util:writeXML);
 
       reporting:W3C-reporting($results,
                               $FOTSZorbaManifestPath)
@@ -184,7 +184,7 @@
 
       (: add test set results:)
       insert nodes
-      for $testSet in $results/fots:test-cases/fots:test-set
+      for $testSet in $results/fots:test-set
       return
       <test-set name="{$testSet/@name}">
         {
@@ -216,45 +216,42 @@
 
 (:~
  : Loops through the test-sets and creates statistics.
- : @param $FOTSCatalog  FOTS catalog file.
- : @param $failures the test reported by Zorba as failed.
- : @param $exceptedTestCases lists of test cases that are not run(empty string
- : means all tests will be run).
- : @param $exceptedTestSets lists of test sets that are not run(empty string
- : means all tests will be run).
- : @param $verbose is set to TRUE it will also output the actual failures.
+ : @param $FOTSCatalogFilePath  Path to the FOTS catalog file.
+ : @param $failures Path to the results fo the FOTS.
  : @return a report of tests run.
  :)
 declare %ann:nondeterministic function reporting:do-reporting(
-  $FOTSCatalog        as document-node(),
-  $catalogBaseURI     as xs:anyURI,
-  $failures,
-  $exceptedTestCases  as xs:string*,
-  $exceptedTestSets   as xs:string*,
-  $verbose            as xs:boolean
+  $FOTSCatalogFilePath  as xs:string,
+  $resultsFilePath      as xs:string
 ) as element(fots:report)
 {
-  let $excepted := count($exceptedTestCases)
-  return
+try
+{
+  {
+    variable $FOTSCatalog := doc(trace(resolve-uri($FOTSCatalogFilePath),
+                                "Path to FOTS catalog.xml set to: "));
+
+    variable $catalogBaseURI := resolve-uri(util:parent-folder($FOTSCatalogFilePath));
+
+    variable $results := parse-xml(file:read-text($resultsFilePath));
+
   <fots:report>
   {
-    let $totalNoTests := count($failures//fots:test-set//fots:test-case),
-        $totalPass := sum(for $testSet in $failures//fots:test-set
+    let $totalNoTests := count($results//fots:test-set//fots:test-case),
+        $totalPass := sum(for $testSet in $results//fots:test-set
                           return count($testSet//fots:test-case[@result ='pass'])),
-        $totalFail := sum(for $testSet in $failures//fots:test-set
+        $totalFail := sum(for $testSet in $results//fots:test-set
                           return count($testSet//fots:test-case[@result ='fail'])),
-        $totalNotApplicable := sum(for $testSet in $failures//fots:test-set
+        $totalNotApplicable := sum(for $testSet in $results//fots:test-set
                                    return count($testSet//fots:test-case[@result ='not applicable'])),
-        $totalNotRun := sum(for $testSet in $failures//fots:test-set
-                            return count($testSet//fots:test-case[@result ='notRun'])),
-        $executionTime := sum(for $testCase in $failures//fots:test-set//fots:test-case return xs:dayTimeDuration($testCase/@executionTime))
+        $totalNotRun := sum(for $testSet in $results//fots:test-set
+                            return count($testSet//fots:test-case[@result ='notRun']))
     return
     <fots:brief totalTests="{$totalNoTests}"
                 totalPass="{$totalPass}"
                 totalFail="{$totalFail}"
                 totalNotApplicable="{$totalNotApplicable}"
-                totalNotRun="{$totalNotRun}"
-                totalExecutionTime="{$executionTime}"/>
+                totalNotRun="{$totalNotRun}"/>
   }
   {
     for $testSetFile in $FOTSCatalog//fots:test-set
@@ -263,15 +260,15 @@
         $testSetDoc := doc($testSetURI),
         $testSetName := data($testSetDoc/fots:test-set/@name),
         $totalNoTestCases := count($testSetDoc//fots:test-case),
-        $totalFailures := for $testCase in $failures//fots:test-set[@name = $testSetName]//fots:test-case[@result ="fail"]
+        $totalFailures := for $testCase in $results//fots:test-set[@name = $testSetName]//fots:test-case[@result ="fail"]
                           return $testCase,
         $percent := round((1 - (count($totalFailures) div $totalNoTestCases))*100,2),
-        $executionTime := sum(for $testCase in $failures//fots:test-set[@name = $testSetName]//fots:test-case
+        $executionTime := sum(for $testCase in $results//fots:test-set[@name = $testSetName]//fots:test-case
                               return xs:dayTimeDuration($testCase/@executionTime))
+    where count($totalFailures) gt 0
     order by count($totalFailures) descending
     return
     <fots:test-set  name="{$testSetName}"
-                    executionTime="{$executionTime}"
                     noFailures="{count($totalFailures)}"
                     noTestCases="{$totalNoTestCases}"
                     percent="{$percent}"
@@ -279,12 +276,20 @@
                                                 order by data($failure/@name)
                                                 return data($failure/@name)
                                               ,",")}">
-   {if (not($verbose))
-    then $totalFailures
-    else ()}
     </fots:test-set>
    }
-   </fots:report>
+  </fots:report>
+  
+  }
+}
+catch *
+{
+  error($err:code,
+        $err:description,
+        concat("&#xA;Please make sure the passed 'fotsPath' points to the ",
+               "exact location of the FOTS catalog.xml:&#xA;",
+               resolve-uri($FOTSCatalogFilePath)))
+}
 };
 
 (:~

=== modified file 'test/fots_driver/util.xq'
--- test/fots_driver/util.xq	2013-02-25 15:39:39 +0000
+++ test/fots_driver/util.xq	2013-02-27 11:57:38 +0000
@@ -63,6 +63,14 @@
     <output:indent                value="yes"  />
   </output:serialization-parameters>;
 
+(:~
+ : The serialization parameters for text serialization.
+ :)
+ declare variable $util:writeXML :=
+  <output:serialization-parameters>
+    <output:method                value="xml" />
+    <output:indent                value="yes"  />
+  </output:serialization-parameters>;
 
 (:~
  : Search within a given test-case for all element nodes with a given node name.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to