Merge lp:~zorba-coders/zorba/fixes_FOTS_driver_29_MAR into lp:zorba

Proposed by Sorin Marian Nasoi
Status: Merged
Approved by: Chris Hillery
Approved revision: 11332
Merged at revision: 11334
Proposed branch: lp:~zorba-coders/zorba/fixes_FOTS_driver_29_MAR
Merge into: lp:zorba
Diff against target: 308 lines (+100/-56)
7 files modified
test/fots/CMakeLists.txt (+0/-35)
test/fots/ImportFOTS.cmake (+1/-1)
test/fots_driver/FOTSZorbaManifest.xml (+3/-2)
test/fots_driver/environment.xq (+20/-0)
test/fots_driver/feedback.xq (+6/-2)
test/fots_driver/fots-driver.xq (+14/-2)
test/fots_driver/tools/dependencies.xq (+56/-14)
To merge this branch: bzr merge lp:~zorba-coders/zorba/fixes_FOTS_driver_29_MAR
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Sorin Marian Nasoi Approve
Review via email: mp+156109@code.launchpad.net

Commit message

- updated FOTS snapshot to March 29th. Updated expected failures accordingly.
- if a test did not pass, we further check if the reason it failed is an environment dependency on setting of a default COLLECTION or COLLATION URI (other that Unicode Codepoint Collation). If so, we report the test case as "notRun" otherwise we report it as "fail". This change decreased the number of failing test cases by 34 (and increased the number of test cases "notRun" by the same amount).
- corrected errors in FOTSZorbaManifest.xml
- modified 'tools/dependencies.xq' to scan FOTS for all dependencies that are not appearing in FOTSZorbaManifest.xml and report them.

Description of the change

- updated FOTS snapshot to March 29th. Updated expected failures accordingly.
- if a test did not pass, we further check if the reason it failed is an environment dependency on setting of a default COLLECTION or COLLATION URI (other that Unicode Codepoint Collation). If so, we report the test case as "notRun" otherwise we report it as "fail". We first try running the test case because 130 test case actually PASS although their used environment requires setting a default COLECTION or COLLATION URI. This change decreased the number of failing test cases by 34 (and increased the number of test cases "notRun" by the same amount).

To post a comment you must log in.
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job fixes_FOTS_driver_29_MAR-2013-03-29T06-29-40.76Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve.

Revision history for this message
Chris Hillery (ceejatec) wrote :

The changes seem OK for now; however, they don't actually *fix* the two related bugs, do they?

review: Approve
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

> The changes seem OK for now; however, they don't actually *fix* the two
> related bugs, do they?
They do actually because they correctly marked some bugs as notRun instead of fail (which according to W3C is OK).
If we decide we want to increase the number of test cases that PASS, additional work needs to be done in XQXQ for both of those bugs.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

Please also see:
https://bugs.launchpad.net/zorba/+bug/1160111/comments/2

My understanding of the comment is this:
Step 1) minimise the number of failing test cases as much as possible
Step 2) maximize the number of passing test cases as much as possible

What is your opinion?

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

One more thing: even Mike Kay says that these 2 let's call them features (ability to define COLLECTIONS and to set COLLATION URI's) is like

"implicit dependency [...] An implementation that cannot set the context as required should behave in the same way as if a dependency has not been satisfied, ideally reporting the test as "notRun" with a reason."
taken from http://dev.w3.org/2011/QT3-test-suite/guide/running.html

So the proposed changed implement the ideal case where Zorba report's the test cases as "notRun" with information about the reason it did not run them.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/fixes_FOTS_driver_29_MAR into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job fixes_FOTS_driver_29_MAR-2013-04-02T08-36-45.465Z is
  finished. The final status was:

  2 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job fixes_FOTS_driver_29_MAR-2013-04-02T18-06-54.471Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'test/fots/CMakeLists.txt'
--- test/fots/CMakeLists.txt 2013-03-27 17:11:24 +0000
+++ test/fots/CMakeLists.txt 2013-03-29 08:37:25 +0000
@@ -135,31 +135,12 @@
135EXPECTED_FOTS_FAILURE (fn-available-environment-variables fn-available-environment-variables-011 0)135EXPECTED_FOTS_FAILURE (fn-available-environment-variables fn-available-environment-variables-011 0)
136EXPECTED_FOTS_FAILURE (fn-avg cbcl-avg-002 0)136EXPECTED_FOTS_FAILURE (fn-avg cbcl-avg-002 0)
137EXPECTED_FOTS_FAILURE (fn-avg cbcl-avg-003 0)137EXPECTED_FOTS_FAILURE (fn-avg cbcl-avg-003 0)
138EXPECTED_FOTS_FAILURE (fn-collection fn-collection-4 0)
139EXPECTED_FOTS_FAILURE (fn-collection fn-collection-4d 0)
140EXPECTED_FOTS_FAILURE (fn-collection fn-collection-5 0)
141EXPECTED_FOTS_FAILURE (fn-collection fn-collection-5d 0)
142EXPECTED_FOTS_FAILURE (fn-collection fn-collection-6 0)
143EXPECTED_FOTS_FAILURE (fn-collection fn-collection-8 0)
144EXPECTED_FOTS_FAILURE (fn-collection fn-collection-9 0)
145EXPECTED_FOTS_FAILURE (fn-collection fn-collection-10 0)
146EXPECTED_FOTS_FAILURE (fn-collection fn-collection-10d 0)
147EXPECTED_FOTS_FAILURE (fn-compare compare-010 0)
148EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-56 0)
149EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-57 0)
150EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-58 0)
151EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-59 0)
152EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-60 0)
153EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-61 0)
154EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-62 0)
155EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-63 0)
156EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-36 0)138EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-36 0)
157EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-37 0)139EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-37 0)
158EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-38 0)140EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-38 0)
159EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-39 0)141EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-39 0)
160EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002 0)142EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002 0)
161EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002b 0)143EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002b 0)
162EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-003 0)
163EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-005 0)144EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-005 0)
164EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-006 0)145EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-006 0)
165EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-007 0)146EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-007 0)
@@ -218,8 +199,6 @@
218EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-004 0)199EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-004 0)
219EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-005 0)200EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-005 0)
220EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-006 0)201EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-006 0)
221EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-012 0)
222EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-013 0)
223EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-014 0)202EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-014 0)
224EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-015 0)203EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-015 0)
225EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-017 0)204EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-017 0)
@@ -285,8 +264,6 @@
285EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-017 0)264EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-017 0)
286EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-018 0)265EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-018 0)
287EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-024 0)266EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-024 0)
288EXPECTED_FOTS_FAILURE (fn-substring-after fn-substring-after-24 0)
289EXPECTED_FOTS_FAILURE (fn-substring-before fn-substring-before-24 0)
290EXPECTED_FOTS_FAILURE (fn-tokenize fn-tokenize-31 0)267EXPECTED_FOTS_FAILURE (fn-tokenize fn-tokenize-31 0)
291EXPECTED_FOTS_FAILURE (fn-tokenize fn-tokenize-32 0)268EXPECTED_FOTS_FAILURE (fn-tokenize fn-tokenize-32 0)
292EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-037 0)269EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-037 0)
@@ -623,13 +600,7 @@
623EXPECTED_FOTS_FAILURE (xs-token cbcl-token-002b 0)600EXPECTED_FOTS_FAILURE (xs-token cbcl-token-002b 0)
624EXPECTED_FOTS_FAILURE (xs-token cbcl-token-004 0)601EXPECTED_FOTS_FAILURE (xs-token cbcl-token-004 0)
625EXPECTED_FOTS_FAILURE (fn-fold-left fold-left-009 0)602EXPECTED_FOTS_FAILURE (fn-fold-left fold-left-009 0)
626EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-018 0)
627EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-020 0)
628EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-062 0)603EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-062 0)
629EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-370 0)
630EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-372 0)
631EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-374 0)
632EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-376 0)
633EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-402 0)604EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-402 0)
634EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-404 0)605EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-404 0)
635EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-494 0)606EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-494 0)
@@ -658,13 +629,7 @@
658EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-038 0)629EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-038 0)
659EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-039 0)630EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-039 0)
660EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof140 0)631EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof140 0)
661EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-018 0)
662EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-020 0)
663EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-062 0)632EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-062 0)
664EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-370 0)
665EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-372 0)
666EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-374 0)
667EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-376 0)
668EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-402 0)633EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-402 0)
669EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-404 0)634EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-404 0)
670EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-494 0)635EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-494 0)
671636
=== modified file 'test/fots/ImportFOTS.cmake'
--- test/fots/ImportFOTS.cmake 2013-03-21 20:02:48 +0000
+++ test/fots/ImportFOTS.cmake 2013-03-29 08:37:25 +0000
@@ -19,7 +19,7 @@
1919
2020
21# Change this to publish updated FOTS archives21# Change this to publish updated FOTS archives
22SET (FOTS_ARCHIVE "FOTS_210313.tgz")22SET (FOTS_ARCHIVE "FOTS_290313.tgz")
2323
24# Change this to modify which elements in FOTS driver results are output24# Change this to modify which elements in FOTS driver results are output
25# as CDATA25# as CDATA
2626
=== modified file 'test/fots_driver/FOTSZorbaManifest.xml'
--- test/fots_driver/FOTSZorbaManifest.xml 2013-03-15 08:22:41 +0000
+++ test/fots_driver/FOTSZorbaManifest.xml 2013-03-29 08:37:25 +0000
@@ -1,6 +1,6 @@
1<test-suite-result xmlns="http://www.w3.org/2010/09/qt-fots-catalog">1<test-suite-result xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
2 <dependency type="feature" value="collection-stability" satisfied="true"/> <!-- Is this correct? -->2 <dependency type="feature" value="collection-stability" satisfied="false"/>
3 <dependency type="feature" value="directory-as-collection-uri" satisfied="true"/> <!-- Is this correct? -->3 <dependency type="feature" value="directory-as-collection-uri" satisfied="false"/>
4 <dependency type="feature" value="higherOrderFunctions" satisfied="true"/>4 <dependency type="feature" value="higherOrderFunctions" satisfied="true"/>
5 <dependency type="feature" value="moduleImport" satisfied="true"/>5 <dependency type="feature" value="moduleImport" satisfied="true"/>
6 <dependency type="feature" value="namespace-axis" satisfied="false"/> <!-- Is this correct? -->6 <dependency type="feature" value="namespace-axis" satisfied="false"/> <!-- Is this correct? -->
@@ -14,6 +14,7 @@
14 <dependency type="spec" value="XP10 XQ10" satisfied="true"/>14 <dependency type="spec" value="XP10 XQ10" satisfied="true"/>
15 <dependency type="spec" value="XP10+" satisfied="true"/>15 <dependency type="spec" value="XP10+" satisfied="true"/>
16 <dependency type="spec" value="XP20 XQ10" satisfied="true"/>16 <dependency type="spec" value="XP20 XQ10" satisfied="true"/>
17 <dependency type="spec" value="XP20" satisfied="true"/>
17 <dependency type="spec" value="XP20+" satisfied="true"/>18 <dependency type="spec" value="XP20+" satisfied="true"/>
18 <dependency type="spec" value="XP30+" satisfied="true"/>19 <dependency type="spec" value="XP30+" satisfied="true"/>
19 <dependency type="spec" value="XP30+ XQ10+" satisfied="true"/>20 <dependency type="spec" value="XP30+ XQ10+" satisfied="true"/>
2021
=== modified file 'test/fots_driver/environment.xq'
--- test/fots_driver/environment.xq 2013-03-26 16:25:16 +0000
+++ test/fots_driver/environment.xq 2013-03-29 08:37:25 +0000
@@ -759,3 +759,23 @@
759 else ()759 else ()
760 }760 }
761};761};
762
763(:~
764 : Checks if a test case should be run. Possible reasons for not running a test
765 : according to http://dev.w3.org/2011/QT3-test-suite/guide/running.html:
766 : - the environment requires the setting of collections
767 : - the environment requires the setting of collation URIs
768 :
769 :
770 :)
771declare function env:check-prerequisites(
772 $case as element(fots:test-case),
773 $env as element(fots:environment)?
774) as xs:string?
775{
776 if(exists($case/fots:environment/fots:collection) or exists($env/fots:collection))
777 then 'Default collection is always an empty sequence.'
778 else if (exists($case/fots:environment/fots:collation) or exists($env/fots:collation))
779 then 'Can not define any other collations (other than the Unicode Codepoint Collation).'
780 else ()
781};
762782
=== modified file 'test/fots_driver/feedback.xq'
--- test/fots_driver/feedback.xq 2013-03-18 12:53:46 +0000
+++ test/fots_driver/feedback.xq 2013-03-29 08:37:25 +0000
@@ -211,16 +211,20 @@
211 : in the $exceptedTestCases global var).211 : in the $exceptedTestCases global var).
212 :212 :
213 : @param $case test case.213 : @param $case test case.
214 : @param $error the reason for which the test case was not run.
214 : @return the test case.215 : @return the test case.
215 :)216 :)
216declare function feedback:not-run(217declare function feedback:not-run(
217 $case as element(fots:test-case)218 $case as element(fots:test-case),
219 $error as xs:string?
218) as element(fots:test-case)?220) as element(fots:test-case)?
219{221{
220 trace(data($case/@name), "processing test case :");222 trace(data($case/@name), "processing test case :");
221 trace("Above test case was not run.","");223 trace("Above test case was not run.","");
222224
223 <fots:test-case name="{$case/@name}" result="notRun" />225 if(exists($error))
226 then <fots:test-case name="{$case/@name}" result="notRun" comment="{$error}"/>
227 else <fots:test-case name="{$case/@name}" result="notRun" />
224};228};
225229
226230
227231
=== modified file 'test/fots_driver/fots-driver.xq'
--- test/fots_driver/fots-driver.xq 2013-03-21 18:43:40 +0000
+++ test/fots_driver/fots-driver.xq 2013-03-29 08:37:25 +0000
@@ -667,7 +667,7 @@
667 return667 return
668 if ($isExcepted)668 if ($isExcepted)
669 then669 then
670 feedback:not-run($testCase)670 feedback:not-run($testCase, ())
671 else671 else
672 feedback:not-applicable($testCase,672 feedback:not-applicable($testCase,
673 string-join($depMet,''))673 string-join($depMet,''))
@@ -711,7 +711,7 @@
711 $verbose,711 $verbose,
712 fn:false())712 fn:false())
713 else713 else
714 feedback:not-run($testCase)714 feedback:not-run($testCase,())
715 }715 }
716 else if (exists($depMet)) then716 else if (exists($depMet)) then
717 {717 {
@@ -859,6 +859,8 @@
859 $testSetBaseURI);859 $testSetBaseURI);
860860
861 variable $duration := (datetime:current-dateTime() - $startDateTime);861 variable $duration := (datetime:current-dateTime() - $startDateTime);
862
863 variable $prerequisitesError as xs:string? := env:check-prerequisites($case, $env);
862864
863 if (feedback:check-pass($result, $queryName, $testSetName, $expectedFailure))865 if (feedback:check-pass($result, $queryName, $testSetName, $expectedFailure))
864 then866 then
@@ -869,6 +871,16 @@
869 $duration,871 $duration,
870 $verbose,872 $verbose,
871 exists($expectedFailure))873 exists($expectedFailure))
874 (:
875 If the test case did not pass, we check to see if the failure is caused
876 by a environment that requires setting of a COLLATION or COLLECTION.
877 There are over 130 test cases that are using an environment that requires
878 setting a COLLATION or COLLECTION but they still PASS even if this setting
879 is not done. That is why we first run the test case.
880 :)
881 else if(exists($prerequisitesError))
882 then
883 feedback:not-run($case, $prerequisitesError)
872 else884 else
873 feedback:fail($case,885 feedback:fail($case,
874 $result,886 $result,
875887
=== modified file 'test/fots_driver/tools/dependencies.xq'
--- test/fots_driver/tools/dependencies.xq 2012-11-13 10:45:24 +0000
+++ test/fots_driver/tools/dependencies.xq 2013-03-29 08:37:25 +0000
@@ -1,27 +1,69 @@
1(: this query loads a rezults.xml file and reports the number of 'non applicable' tests grouped by feature :)1(: this query loads a results.xml file and reports the number of 'non applicable' tests grouped by feature :)
2(: 2(:
3 sample usage3 sample usage (please note that base-uri has to be an absolute URI)
4
4 ./zorba -f -q ../../test/fots_driver/tools/dependencies.xq5 ./zorba -f -q ../../test/fots_driver/tools/dependencies.xq
5 -e pathFailures:=results_12_nov.xml6 -e pathFailures:=results.xml
7 --base-uri "/home/spungi/work/zorba/repo/tmp/fix_fots_driver/build/test/fots/2011/QT3-test-suite/catalog.xml"
6 -o driver_dependencies.xml8 -o driver_dependencies.xml
7 --indent9 --indent
8:)10 :)
911
10 import module namespace file = "http://expath.org/ns/file";12 import module namespace file = "http://expath.org/ns/file";
13 import schema namespace fots = "http://www.w3.org/2010/09/qt-fots-catalog" at "catalog-schema.xsd";
11 14
12 declare default element namespace "http://www.w3.org/2010/09/qt-fots-catalog";15 declare default element namespace "http://www.w3.org/2010/09/qt-fots-catalog";
13 declare namespace fots = "http://www.w3.org/2010/09/qt-fots-catalog";
14 16
15 declare variable $pathFailures external;17 declare variable $pathFailures external;
1618 declare variable $pathFOTSZorbaManifest external :=
19 "../../../../../test/fots_driver/FOTSZorbaManifest.xml";
20
21(:~
22 : This function is actually written by Michael Kay, Saxonica 18 July 2011 and
23 : is part of the http://dev.w3.org/cvsweb/2011/QT3-test-suite/tools/dependencies.xq
24 :)
25 declare function local:mk_dependencies($t as element(fots:test-case)) as element(fots:dependency)* {
26 $t/fots:dependency | $t/../fots:dependency
27 };
28
29(:~
30 : This function is actually written by Michael Kay, Saxonica 18 July 2011 and
31 : is part of the http://dev.w3.org/cvsweb/2011/QT3-test-suite/tools/dependencies.xq
32 :)
33 declare function local:mk_FOTS_dependencies() as element(fots:dependency)* {
34 let $test-sets :=
35 for $s in doc('catalog.xml')/fots:catalog/fots:test-set
36 let $uri := resolve-uri($s/@file, base-uri($s))
37 return doc($uri)/*
38 for $d in distinct-values($test-sets//fots:dependency/@type)
39 return
40 <dependency type="{$d}"> {
41 let $de := $test-sets//fots:dependency[@type = $d]
42 for $v in distinct-values($de/@value)
43 return
44 <value number-of-tests="{count($test-sets/fots:test-case[local:mk_dependencies(.)[@type = $d and @value = $v]])}">
45 {$v}
46 </value>
47 }</dependency>
48 };
49
17 variable $failures := fn:parse-xml(file:read-text($pathFailures));50 variable $failures := fn:parse-xml(file:read-text($pathFailures));
51 variable $FOTSZorbaManifest := doc(resolve-uri($pathFOTSZorbaManifest));
52 variable $notDefinedInZorba :=
53 for $dep in local:mk_FOTS_dependencies()
54 for $depval in $dep/value
55 where empty($FOTSZorbaManifest/fots:test-suite-result/fots:dependency[@type=$dep/@type and @value=$depval])
56 return <dependency type="{$dep/@type}" value="{$depval/text()}" />;
18 57
19 <report> {58 <report number-of-tests="{count($failures/fots:test-cases/fots:test-set/fots:test-case[@result="n/a"])}" > {
20 for $d in distinct-values(data($failures/fots:test-cases/fots:test-set/fots:test-case[@result="not applicable"]/@comment))59 (for $d in distinct-values(data($failures/fots:test-cases/fots:test-set/fots:test-case[@result="n/a"]/@comment))
21 order by $d60 let $failures := count($failures/fots:test-cases//fots:test-set//fots:test-case[@result="n/a" and @comment=$d])
61 order by $failures descending, $d
22 return62 return
23 <dependency type="{$d}"> {
24 <value number-of-tests="{count($failures/fots:test-cases//fots:test-set//fots:test-case[@result="not applicable" and @comment=$d])}" />
25 }</dependency>
26 }</report>
27
28\ No newline at end of file63\ No newline at end of file
64 <dependency number-of-tests="{$failures}" type="{$d}" />,
65 if (empty($notDefinedInZorba))
66 then <!-- There are no dependencies in FOTS that are not declared in FOTSZorbaManifest.xml -->
67 else (<!-- Following dependency from FOTS is not defined in FOTSZorbaManifest.xml -->,
68 $notDefinedInZorba)
69 )
70 }</report>
29\ No newline at end of file71\ No newline at end of file

Subscribers

People subscribed via source and target branches