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

Proposed by Sorin Marian Nasoi
Status: Merged
Approved by: Sorin Marian Nasoi
Approved revision: 11134
Merged at revision: 11135
Proposed branch: lp:~zorba-coders/zorba/fix_bug_1081678
Merge into: lp:zorba
Diff against target: 292 lines (+99/-35)
4 files modified
test/fots_driver/README.TXT (+2/-1)
test/fots_driver/cli.xq (+28/-19)
test/fots_driver/fots-driver.xq (+66/-12)
test/fots_driver/reporting.xq (+3/-3)
To merge this branch: bzr merge lp:~zorba-coders/zorba/fix_bug_1081678
Reviewer Review Type Date Requested Status
Nicolae Brinza Approve
Sorin Marian Nasoi Approve
Review via email: mp+136367@code.launchpad.net

Commit message

Added a new option in the FOTS driver that allows running only the test cases that have a certain dependency defined.

Description of the change

Added a new option in the FOTS driver that allows running only the test cases that have a certain dependency defined.

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
Nicolae Brinza (nbrinza) :
review: Approve
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/fix_bug_1081678 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 fix_bug_1081678-2012-11-28T10-51-48.283Z 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 fix_bug_1081678-2012-11-28T19-32-45.214Z 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
1=== modified file 'test/fots_driver/README.TXT'
2--- test/fots_driver/README.TXT 2012-11-19 07:08:11 +0000
3+++ test/fots_driver/README.TXT 2012-11-27 11:11:35 +0000
4@@ -37,12 +37,13 @@
5 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-sets
6 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-sets -e testSetPrefixes:=prod,app
7 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e testSetPrefixes:=prod-Literal
8+zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e dependency:=higherOrderFunctions
9 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-matching-test-cases -e pattern:=catch
10 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -o result.xml --indent
11+zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -e dependency:=higherOrderFunctions_false -o result.xml --indent
12 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod-Literal -e verbose:=false -o result.xml --indent
13 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-case -e testSetName:=prod-Literal -e testCaseName:=Literals001 -o result.xml --indent
14 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-case -e assertType:=assert-count -e testSetName:=fn-innermost -o result.xml --indent
15 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-case -e assertType:=assert-count -o result.xml --indent
16 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-and-report -o report.xml --indent
17 zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=report -e failuresFilePath:=failures.xml -e verbose:=false -o report.xml --indent
18-
19
20=== modified file 'test/fots_driver/cli.xq'
21--- test/fots_driver/cli.xq 2012-11-19 07:08:11 +0000
22+++ test/fots_driver/cli.xq 2012-11-27 11:11:35 +0000
23@@ -31,7 +31,7 @@
24 declare variable $fotsZorbaManifestPath as xs:string external :=
25 "FOTSZorbaManifest.xml";
26
27-(:~ The path to the results from a previous run :)
28+(:~ Path to the results from a previous run :)
29 declare variable $failuresFilePath as xs:string external := "";
30
31 (:~ choose the CLI option you want to run :)
32@@ -58,9 +58,12 @@
33 :)
34 declare variable $showResult as xs:string external := "true";
35
36-(:~ list of assertion types :)
37+(:~ assertion type :)
38 declare variable $assertType as xs:string external := "";
39
40+(:~ dependency: used in 'list-test-cases' and 'run-test-sets' modes:)
41+declare variable $dependency as xs:string external := "";
42+
43 (:~ regex for the tests in the 'list-matching-test-cases' option :)
44 declare variable $pattern as xs:string external := "";
45
46@@ -93,8 +96,10 @@
47 "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-sets",
48 "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-sets -e testSetPrefixes:=prod,app",
49 "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e testSetPrefixes:=prod-Literal",
50+ "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e dependency:=higherOrderFunctions",
51 "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-matching-test-cases -e pattern:=catch",
52 "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -o result.xml --indent",
53+ "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -e dependency:=higherOrderFunctions_false -o result.xml --indent",
54 "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod-Literal -e verbose:=false -o result.xml --indent",
55 "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-case -e testSetName:=prod-Literal -e testCaseName:=Literals001 -o result.xml --indent",
56 "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-case -e assertType:=assert-count -e testSetName:=fn-innermost -o result.xml --indent",
57@@ -120,25 +125,27 @@
58 case "list-test-sets"
59 return
60 string-join(
61- (d:list-test-sets(trace($fotsPath,
62- "The path to FOTS catalog.xml was set to: "),
63- local:tokenize(trace($testSetPrefixes,
64- "'testSetPrefixes' was set to: ")))),
65+ (d:list-test-sets(
66+ trace($fotsPath, "Path to FOTS catalog.xml set to: "),
67+ local:tokenize(trace($testSetPrefixes, "'testSetPrefixes' set to: ")))),
68 "
")
69 case "list-test-cases"
70 return
71- string-join((d:list-test-cases(
72- trace($fotsPath,
73- "The path to FOTS catalog.xml was set to: "),
74- local:tokenize(trace($testSetPrefixes,
75- "'testSetPrefixes' was set to: "))), ""),
76- "
")
77+ string-join(
78+ (d:list-test-cases( trace($fotsPath,
79+ "Path to FOTS catalog.xml set to: "),
80+ local:tokenize(trace($testSetPrefixes,
81+ "'testSetPrefixes' set to: ")),
82+ "",
83+ trace($dependency,
84+ "'dependency' set to:"))),
85+ "
")
86 case "list-matching-test-cases"
87 return string-join((d:list-matching-test-cases(
88 trace($fotsPath,
89- "The path to FOTS catalog.xml was set to: "),
90+ "Path to FOTS catalog.xml set to: "),
91 trace($pattern,
92- "pattern was set to: "),
93+ "pattern set to: "),
94 trace($flags,
95 "flags were set to: ")), ""),
96 "
")
97@@ -147,11 +154,13 @@
98 $fotsZorbaManifestPath,
99 d:list-test-sets($fotsPath,
100 local:tokenize(trace($testSetPrefixes,
101- "'testSetPrefixes' was set to: "))),
102+ "'testSetPrefixes' set to: "))),
103 d:list-test-cases($fotsPath,
104 local:tokenize($testSetPrefixes),
105 local:tokenize(trace($testCasePrefixes,
106- "'$testCasePrefixes' was set to: "))),
107+ "'$testCasePrefixes' set to: ")),
108+ trace($dependency,
109+ "'dependency' set to:")),
110 $exceptedTestCases,
111 $exceptedTestSets,
112 $assertType,
113@@ -160,11 +169,11 @@
114 case "run-test-case"
115 return d:run-fots($fotsPath,
116 $fotsZorbaManifestPath,
117- trace($testSetName,"'testSetName' was set to: "),
118- trace($testCaseName,"'testCaseName' was set to: "),
119+ trace($testSetName,"'testSetName' set to: "),
120+ trace($testCaseName,"'testCaseName' set to: "),
121 $exceptedTestCases,
122 $exceptedTestSets,
123- trace($assertType,"'assertType' was set to: "),
124+ trace($assertType,"'assertType' set to: "),
125 xs:boolean($verbose),
126 xs:boolean($showResult))
127 case "run-and-report"
128
129=== modified file 'test/fots_driver/fots-driver.xq'
130--- test/fots_driver/fots-driver.xq 2012-11-20 07:32:15 +0000
131+++ test/fots_driver/fots-driver.xq 2012-11-27 11:11:35 +0000
132@@ -72,16 +72,65 @@
133 return data($testSet/@name)
134 };
135
136+declare %private function driver:matches-dependency(
137+ $dependencies as element(fots:dependency)*,
138+ $filter as xs:string
139+) as xs:boolean {
140+ let $filter := tokenize($filter, '_')
141+ let $depValue := $filter[1]
142+ let $depSatisfied as xs:string := if(exists($filter[2]) and
143+ ($filter[2] = 'true' or $filter[2]='false'))
144+ then $filter[2]
145+ else 'true'
146+ return
147+ if(xs:boolean($depSatisfied))
148+
149+ (: $depSatisfied = 'true' :)
150+ then (exists($dependencies[@value = $depValue and
151+ @satisfied = $depSatisfied]) or
152+ exists($dependencies[@value = $depValue and empty(@satisfied)]))
153+
154+ (: $depSatisfied = 'false' :)
155+ else exists($dependencies[@value = $depValue and
156+ @satisfied = $depSatisfied])
157+};
158+
159+(:~
160+ : Loops through the given test set and returns the test cases that have the
161+ : given dependencies defined.
162+ : @param $testSet test set document.
163+ : @param $dependency defined dependency
164+ : (empty string means all test cases).
165+ : @return matching test case names.
166+ :)
167+declare %private function driver:list-test-cases(
168+ $testSetDoc as document-node(),
169+ $dependency as xs:string*
170+) as xs:string* {
171+ if(string-join($dependency,'') = '')
172+ then $testSetDoc//fots:test-case/@name
173+ else for $testCase in $testSetDoc//fots:test-case
174+ let $cond := driver:matches-dependency(($testSetDoc/fots:test-set/fots:dependency,
175+ $testCase/fots:dependency),
176+ $dependency)
177+ where $cond
178+ return$testCase/@name
179+
180+};
181+
182 (:~
183 : Loops through the given test sets and returns the corresponding test cases.
184 : @param $fotsPath path to the FOTS catalog file.
185 : @param $testSetPrefixes name/criteria for the test sets
186- : (empty string means all).
187+ : (empty string means all test cases).
188+ : @param $dependency type of dependency that has to be met
189+ : (empty string means all test cases).
190 : @return available FOTS test cases.
191 :)
192 declare %ann:nondeterministic function driver:list-test-cases(
193 $fotsPath as xs:string,
194- $testSetPrefixes as xs:string*
195+ $testSetPrefixes as xs:string*,
196+ $dependency as xs:string*
197 ) as xs:string* {
198 let $doc := doc(resolve-uri($fotsPath)),
199 $baseUri:= resolve-uri(util:parent-folder($fotsPath))
200@@ -90,31 +139,36 @@
201 then
202 for $testSet in $doc/fots:catalog/fots:test-set
203 let $testSetDoc := doc(resolve-uri($testSet/@file, $baseUri))
204- return data($testSetDoc//fots:test-case/@name)
205+ return driver:list-test-cases($testSetDoc, $dependency)
206 else
207 for $prefix in $testSetPrefixes
208 for $testSet in $doc/fots:catalog/fots:test-set[starts-with(@name, $prefix)]
209 let $testSetDoc := doc(resolve-uri($testSet/@file, $baseUri))
210- return data($testSetDoc//fots:test-case/@name)
211+ return driver:list-test-cases($testSetDoc, $dependency)
212 };
213
214 (:~
215 : Loops through the given test sets and returns the corresponding test cases.
216 : @param $fotsPath path to the FOTS catalog file.
217 : @param $testSetPrefixes name/criteria for the test sets
218- : (empty string means all).
219+ : (empty string means all test cases).
220 : @param $testCasePrefixes name/criteria for the test cases
221- : (empty string means all).
222+ : (empty string means all test cases).
223+ : @param $dependency type of dependency that has to be met
224+ : (empty string means all test cases).
225 : @return available FOTS test cases.
226 :)
227 declare %ann:nondeterministic function driver:list-test-cases(
228 $fotsPath as xs:string,
229 $testSetPrefixes as xs:string*,
230- $testCasePrefixes as xs:string*
231+ $testCasePrefixes as xs:string*,
232+ $dependency as xs:string*
233 ) as xs:string* {
234 let $doc := doc(resolve-uri($fotsPath)),
235 $baseUri:= resolve-uri(util:parent-folder($fotsPath)),
236- $testCaseNames := driver:list-test-cases($fotsPath, $testSetPrefixes)
237+ $testCaseNames := driver:list-test-cases($fotsPath,
238+ $testSetPrefixes,
239+ $dependency)
240 return
241 for $prefix in $testCasePrefixes
242 return
243@@ -197,9 +251,9 @@
244 ) as element(fots:test-cases) {
245 try {
246 let $FOTSCatalog := doc(trace(resolve-uri($FOTSCatalogFilePath),
247- "Path to FOTS catalog.xml was set to: ")),
248+ "Path to FOTS catalog.xml set to: ")),
249 $FOTSZorbaManifest := doc(trace(resolve-uri($FOTSZorbaManifestPath),
250- "Path to FOTSZorbaManifest was set to:"))
251+ "Path to FOTSZorbaManifest set to:"))
252 return driver:run($FOTSCatalog,
253 resolve-uri(util:parent-folder($FOTSCatalogFilePath)),
254 $FOTSZorbaManifest,
255@@ -207,8 +261,8 @@
256 $testCasePrefixes,
257 $exceptedTestCases,
258 $exceptedTestSets,
259- trace($assert, "The filter for 'assert name' was set to: "),
260- trace($verbose, "'Verbose' parameter was set to: "),
261+ trace($assert, "The filter for 'assert name' set to: "),
262+ trace($verbose, "'Verbose' parameter set to: "),
263 $showResult)
264 }
265 catch * {
266
267=== modified file 'test/fots_driver/reporting.xq'
268--- test/fots_driver/reporting.xq 2012-11-19 07:08:11 +0000
269+++ test/fots_driver/reporting.xq 2012-11-27 11:11:35 +0000
270@@ -73,12 +73,12 @@
271 try {
272 {
273 variable $FOTSCatalog := doc(trace(resolve-uri($FOTSCatalogFilePath),
274- "Path to FOTS catalog.xml was set to: "));
275+ "Path to FOTS catalog.xml set to: "));
276
277 variable $catalogBaseURI := resolve-uri(util:parent-folder($FOTSCatalogFilePath));
278
279 variable $FOTSZorbaManifest := doc(trace(resolve-uri($FOTSZorbaManifestPath),
280- "Path to FOTSZorbaManifest was set to:"));
281+ "Path to FOTSZorbaManifest set to:"));
282
283 variable $failures := <fots:FOTS-test-suite-result>{
284 ( $FOTSZorbaManifest//fots:implementation,
285@@ -154,7 +154,7 @@
286 variable $failures := parse-xml(file:read-text($pathFailures));
287
288 variable $FOTSCatalog := doc(trace(resolve-uri($FOTSCatalogFilePath),
289- "Path to FOTS catalog.xml was set to: "));
290+ "Path to FOTS catalog.xml set to: "));
291
292 variable $catalogBaseURI := resolve-uri(util:parent-folder($FOTSCatalogFilePath));
293

Subscribers

People subscribed via source and target branches