Merge lp:~zorba-coders/zorba/prune-rbkt into lp:zorba
- prune-rbkt
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Chris Hillery |
Approved revision: | 11459 |
Merged at revision: | 11459 |
Proposed branch: | lp:~zorba-coders/zorba/prune-rbkt |
Merge into: | lp:zorba |
Diff against target: |
1794 lines (+127/-1375) 32 files modified
test/CMakeLists.txt (+2/-1) test/driver/CMakeLists.txt (+97/-0) test/driver/sax2testdriver.cpp (+1/-1) test/driver/specification.h (+1/-1) test/driver/testdriverconfig.h.in (+11/-6) test/driver/updtestdriver.cpp (+1/-1) test/rbkt/CMakeLists.txt (+1/-76) test/rbkt/Documents/test/bad2.xml (+0/-3) test/rbkt/Documents/test/test1.xml (+0/-6) test/rbkt/Documents/test/test2.xml (+0/-5) test/rbkt/Documents/test/test3.xml (+0/-6) test/rbkt/Documents/test/test4.xml (+0/-15) test/rbkt/ExpLoaderResults/test/test1.xml (+0/-8) test/rbkt/ExpLoaderResults/test/test2.xml (+0/-8) test/rbkt/ExpLoaderResults/test/test3.xml (+0/-8) test/rbkt/ExpLoaderResults/test/test4.xml (+0/-17) test/rbkt/Queries/CMakeLists.txt (+11/-5) test/rbkt/Scripts/CMakeLists.txt (+0/-23) test/rbkt/Scripts/cmp_ctest_logs (+0/-32) test/rbkt/Scripts/functions.sh (+0/-489) test/rbkt/Scripts/lbkt.sh.in (+0/-170) test/rbkt/Scripts/rbkt.sh.in (+0/-205) test/rbkt/Scripts/resultToXml.py.in (+0/-88) test/rbkt/Scripts/tidy_xmlfrag (+0/-15) test/rbkt/Scripts/xqftts.sh (+0/-30) test/sax2/CMakeLists.txt (+0/-13) test/sax2/sax2testdriverconfig.h.in (+0/-26) test/timer.h (+0/-73) test/unit/CMakeLists.txt (+1/-0) test/unit/cxx_api_changes.cpp (+1/-1) test/update/CMakeLists.txt (+0/-16) test/update/testdriverconfig.h.in (+0/-27) |
To merge this branch: | bzr merge lp:~zorba-coders/zorba/prune-rbkt |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juan Zacarias | Approve | ||
Chris Hillery | Approve | ||
Review via email: mp+164088@code.launchpad.net |
Commit message
Consolidate all test driver sources into one place. Eliminate stale and unused scripts and source.
Description of the change
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/prune-rbkt into lp:zorba failed. Below is the output from the failed tests.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job prune-rbkt-
All tests succeeded!
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 Pending.
Chris Hillery (ceejatec) : | # |
Juan Zacarias (juan457) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job prune-rbkt-
All tests succeeded!
Preview Diff
1 | === modified file 'test/CMakeLists.txt' |
2 | --- test/CMakeLists.txt 2013-05-14 10:07:03 +0000 |
3 | +++ test/CMakeLists.txt 2013-05-16 09:25:46 +0000 |
4 | @@ -23,11 +23,12 @@ |
5 | |
6 | INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/src) |
7 | INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR}/src) |
8 | -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR}/test) |
9 | INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) |
10 | |
11 | INCLUDE(${CMAKE_SOURCE_DIR}/cmake_modules/ZorbaGenerateExe.cmake) |
12 | |
13 | +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/driver) |
14 | +ADD_SUBDIRECTORY(driver) |
15 | ADD_SUBDIRECTORY(api) |
16 | ADD_SUBDIRECTORY(rbkt) |
17 | ADD_SUBDIRECTORY(extern) |
18 | |
19 | === removed directory 'test/commons' |
20 | === added directory 'test/driver' |
21 | === added file 'test/driver/CMakeLists.txt' |
22 | --- test/driver/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
23 | +++ test/driver/CMakeLists.txt 2013-05-16 09:25:46 +0000 |
24 | @@ -0,0 +1,97 @@ |
25 | +# Copyright 2006-2013 The FLWOR Foundation. |
26 | +# |
27 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
28 | +# you may not use this file except in compliance with the License. |
29 | +# You may obtain a copy of the License at |
30 | +# |
31 | +# http://www.apache.org/licenses/LICENSE-2.0 |
32 | +# |
33 | +# Unless required by applicable law or agreed to in writing, software |
34 | +# distributed under the License is distributed on an "AS IS" BASIS, |
35 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
36 | +# See the License for the specific language governing permissions and |
37 | +# limitations under the License. |
38 | + |
39 | +# configure the testdrivers |
40 | +CONFIGURE_FILE(testdriverconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/testdriverconfig.h) |
41 | +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) |
42 | + |
43 | + |
44 | +# |
45 | +# Compile and build the testdriver executable |
46 | +# |
47 | +SET (TESTDRIVER_SRCS |
48 | + testdriver.cpp |
49 | + testdriver_common.cpp |
50 | + testdriver_comparator.cpp |
51 | + testuriresolver.cpp |
52 | + ) |
53 | + |
54 | +ZORBA_GENERATE_EXE("testdriver" "${TESTDRIVER_SRCS}" "" "" "bin") |
55 | + |
56 | +# |
57 | +# Compile and build the multi-threaded testdriver executable, if boost |
58 | +# available |
59 | +# |
60 | + |
61 | +FIND_PACKAGE(Boost COMPONENTS filesystem) |
62 | +IF (NOT Boost_FILESYSTEM_FOUND) |
63 | + MESSAGE(STATUS "Boost filesystem or system component not found - not building multithreaded test driver") |
64 | +ELSE (NOT Boost_FILESYSTEM_FOUND) |
65 | + MESSAGE(STATUS "Found Boost v${Boost_LIB_VERSION}: ${Boost_INCLUDE_DIRS}") |
66 | + MESSAGE(STATUS " Boost lib path: ${Boost_LIBRARY_DIRS}") |
67 | + |
68 | + # Assume this is OK for the moment... |
69 | + SET (ZORBATEST_TESTDRIVER_MT_AVAILABLE TRUE) |
70 | + |
71 | + IF (Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION GREATER 34) |
72 | + # Boost 1.35 and above included a separate "system" component. In |
73 | + # at least some versions, filesystem depends on system - and the |
74 | + # Mac linker apparently does not figure this out. Therefore we |
75 | + # need to link it explicitly, which means we need to find it |
76 | + # first. |
77 | + FIND_PACKAGE(Boost COMPONENTS system) |
78 | + IF (NOT Boost_SYSTEM_FOUND) |
79 | + MESSAGE(STATUS "Did NOT find Boost SYSTEM component - not building multithreaded test driver") |
80 | + SET (ZORBATEST_TESTDRIVER_MT_AVAILABLE FALSE) |
81 | + ELSE (NOT Boost_SYSTEM_FOUND) |
82 | + SET (Boost_system_lib "boost_system-mt") |
83 | + ENDIF (NOT Boost_SYSTEM_FOUND) |
84 | + |
85 | + ENDIF (Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION GREATER 34) |
86 | + |
87 | +ENDIF (NOT Boost_FILESYSTEM_FOUND) |
88 | + |
89 | +IF (ZORBATEST_TESTDRIVER_MT_AVAILABLE) |
90 | + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) |
91 | + |
92 | + SET (TESTDRIVER_MT_SRCS |
93 | + testdriver_mt.cpp |
94 | + testdriver_common.cpp |
95 | + testdriver_comparator.cpp |
96 | + testuriresolver.cpp |
97 | + ) |
98 | + |
99 | + ZORBA_GENERATE_EXE( |
100 | + "testdriver_mt" "${TESTDRIVER_MT_SRCS}" "${Boost_LIBRARIES}" "" "") |
101 | + |
102 | + SET (ZORBATEST_USE_MT_XQTS NO CACHE BOOLEAN |
103 | + "If true, use testdriver_mt (when available) for running XQTS") |
104 | + MARK_AS_ADVANCED (ZORBATEST_USE_MT_XQTS) |
105 | + |
106 | +ENDIF (ZORBATEST_TESTDRIVER_MT_AVAILABLE) |
107 | + |
108 | +# Compile and build the update testdriver executable |
109 | +SET(UPDTESTDRIVER_SRCS |
110 | + updtestdriver.cpp |
111 | + testdriver_comparator.cpp |
112 | + testuriresolver.cpp) |
113 | +ZORBA_GENERATE_EXE("updtestdriver" "${UPDTESTDRIVER_SRCS}" "" "" "") |
114 | + |
115 | +# Compile and build the SAX2 test driver executable |
116 | +SET (SAX2_TESTDRIVER_SRCS |
117 | + sax2testdriver.cpp |
118 | + ${CMAKE_SOURCE_DIR}/test/driver/testdriver_comparator.cpp |
119 | + ) |
120 | + |
121 | +ZORBA_GENERATE_EXE(sax2testdriver "${SAX2_TESTDRIVER_SRCS}" "" "" "") |
122 | |
123 | === renamed file 'test/sax2/sax2testdriver.cpp' => 'test/driver/sax2testdriver.cpp' |
124 | --- test/sax2/sax2testdriver.cpp 2013-02-26 04:12:43 +0000 |
125 | +++ test/driver/sax2testdriver.cpp 2013-05-16 09:25:46 +0000 |
126 | @@ -26,7 +26,7 @@ |
127 | |
128 | #include <zorba/util/file.h> |
129 | |
130 | -#include "sax2testdriverconfig.h" // SRC and BIN dir definitions |
131 | +#include "testdriverconfig.h" // SRC and BIN dir definitions |
132 | |
133 | #include <zorba/zorba.h> |
134 | #include <zorba/default_content_handler.h> |
135 | |
136 | === renamed file 'test/rbkt/specification.h' => 'test/driver/specification.h' |
137 | --- test/rbkt/specification.h 2013-02-07 17:24:36 +0000 |
138 | +++ test/driver/specification.h 2013-05-16 09:25:46 +0000 |
139 | @@ -22,7 +22,7 @@ |
140 | #include <sstream> |
141 | #include <util/ascii_util.h> |
142 | #include <zorba/util/uri.h> |
143 | -#include <testuriresolver.h> |
144 | +#include "testuriresolver.h" |
145 | #include <zorba/uri_resolvers.h> |
146 | |
147 | #undef WIN32_LEAN_AND_MEAN |
148 | |
149 | === renamed file 'test/rbkt/testdriver.cpp' => 'test/driver/testdriver.cpp' |
150 | === renamed file 'test/rbkt/testdriver_common.cpp' => 'test/driver/testdriver_common.cpp' |
151 | === renamed file 'test/rbkt/testdriver_common.h' => 'test/driver/testdriver_common.h' |
152 | === renamed file 'test/commons/testdriver_comparator.cpp' => 'test/driver/testdriver_comparator.cpp' |
153 | === renamed file 'test/commons/testdriver_comparator.h' => 'test/driver/testdriver_comparator.h' |
154 | === renamed file 'test/rbkt/testdriver_mt.cpp' => 'test/driver/testdriver_mt.cpp' |
155 | === renamed file 'test/rbkt/testdriverconfig.h.in' => 'test/driver/testdriverconfig.h.in' |
156 | --- test/rbkt/testdriverconfig.h.in 2013-02-07 17:24:36 +0000 |
157 | +++ test/driver/testdriverconfig.h.in 2013-05-16 09:25:46 +0000 |
158 | @@ -1,5 +1,5 @@ |
159 | /* |
160 | - * Copyright 2006-2008 The FLWOR Foundation. |
161 | + * Copyright 2006-2013 The FLWOR Foundation. |
162 | * |
163 | * Licensed under the Apache License, Version 2.0 (the "License"); |
164 | * you may not use this file except in compliance with the License. |
165 | @@ -14,8 +14,8 @@ |
166 | * limitations under the License. |
167 | */ |
168 | |
169 | -#ifndef XQP_RBKT_TESTDRIVER_CONFIG_H |
170 | -#define XQP_RBKT_TESTDRIVER_CONFIG_H |
171 | +#ifndef ZORBA_TESTDRIVER_CONFIG_H |
172 | +#define ZORBA_TESTDRIVER_CONFIG_H |
173 | |
174 | #cmakedefine ZORBA_TEST_XQUERYX |
175 | |
176 | @@ -25,8 +25,13 @@ |
177 | |
178 | namespace zorba { |
179 | |
180 | -static std::string RBKT_SRC_DIR = "@CMAKE_CURRENT_SOURCE_DIR@"; |
181 | -static std::string RBKT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"; |
182 | +static std::string RBKT_SRC_DIR = "@CMAKE_SOURCE_DIR@/test/rbkt"; |
183 | +static std::string RBKT_BINARY_DIR = "@CMAKE_BINARY_DIR@/test/rbkt"; |
184 | static std::string CMAKE_BINARY_DIR = "@CMAKE_BINARY_DIR@"; |
185 | +static std::string UPDATE_SRC_DIR = "@CMAKE_SOURCE_DIR@/test/update"; |
186 | +static std::string UPDATE_BINARY_DIR = "@CMAKE_BINARY_DIR@/test/update"; |
187 | +static std::string SAX2_SRC_DIR = "@CMAKE_SOURCE_DIR@/test/sax2"; |
188 | +static std::string SAX2_BINARY_DIR = "@CMAKE_BINARY_DIR@/test/sax2"; |
189 | + |
190 | } |
191 | -#endif |
192 | +#endif /* ZORBA_TESTDRIVER_CONFIG_H */ |
193 | |
194 | === renamed file 'test/commons/testuriresolver.cpp' => 'test/driver/testuriresolver.cpp' |
195 | === renamed file 'test/commons/testuriresolver.h' => 'test/driver/testuriresolver.h' |
196 | === renamed file 'test/update/specification.h' => 'test/driver/updspecification.h' |
197 | === renamed file 'test/update/updtestdriver.cpp' => 'test/driver/updtestdriver.cpp' |
198 | --- test/update/updtestdriver.cpp 2013-04-17 16:18:23 +0000 |
199 | +++ test/driver/updtestdriver.cpp 2013-05-16 09:25:46 +0000 |
200 | @@ -26,7 +26,7 @@ |
201 | |
202 | #include "testdriverconfig.h" // SRC and BIN dir definitions |
203 | #include "testuriresolver.h" |
204 | -#include "specification.h" // parsing spec files |
205 | +#include "updspecification.h" // parsing spec files |
206 | #include "common/common.h" |
207 | |
208 | #include <zorba/zorba.h> |
209 | |
210 | === modified file 'test/rbkt/CMakeLists.txt' |
211 | --- test/rbkt/CMakeLists.txt 2013-02-26 04:12:43 +0000 |
212 | +++ test/rbkt/CMakeLists.txt 2013-05-16 09:25:46 +0000 |
213 | @@ -1,4 +1,4 @@ |
214 | -# Copyright 2006-2008 The FLWOR Foundation. |
215 | +# Copyright 2006-2013 The FLWOR Foundation. |
216 | # |
217 | # Licensed under the Apache License, Version 2.0 (the "License"); |
218 | # you may not use this file except in compliance with the License. |
219 | @@ -12,86 +12,11 @@ |
220 | # See the License for the specific language governing permissions and |
221 | # limitations under the License. |
222 | |
223 | -ADD_SUBDIRECTORY(Scripts) |
224 | ADD_SUBDIRECTORY(ExpCompilerResults) |
225 | |
226 | -# configure the testdriver |
227 | -CONFIGURE_FILE(testdriverconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/testdriverconfig.h) |
228 | - |
229 | # configure itertest |
230 | CONFIGURE_FILE(itertest.xq.in ${CMAKE_CURRENT_BINARY_DIR}/itertest.xq) |
231 | |
232 | -# |
233 | -# Compile and build the testdriver executable |
234 | -# |
235 | -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) |
236 | -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/test/commons) |
237 | - |
238 | -SET (TESTDRIVER_SRCS |
239 | - testdriver.cpp |
240 | - testdriver_common.cpp |
241 | - ${CMAKE_SOURCE_DIR}/test/commons/testdriver_comparator.cpp |
242 | - ${CMAKE_SOURCE_DIR}/test/commons/testuriresolver.cpp |
243 | - ) |
244 | - |
245 | -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) |
246 | -INCLUDE(ZorbaGenerateExe) |
247 | -ZORBA_GENERATE_EXE("testdriver" "${TESTDRIVER_SRCS}" "" "" "bin") |
248 | -#SET_TARGET_PROPERTIES(testdriver PROPERTIES OUTPUT_NAME zorba-testdriver) |
249 | - |
250 | - |
251 | -# |
252 | -# Compile and build the multi-threaded testdriver executable, if boost |
253 | -# available |
254 | -# |
255 | - |
256 | -FIND_PACKAGE(Boost COMPONENTS filesystem) |
257 | -IF (NOT Boost_FILESYSTEM_FOUND) |
258 | - MESSAGE(STATUS "Boost filesystem or system component not found - not building multithreaded test driver") |
259 | -ELSE (NOT Boost_FILESYSTEM_FOUND) |
260 | - MESSAGE(STATUS "Found Boost v${Boost_LIB_VERSION}: ${Boost_INCLUDE_DIRS}") |
261 | - MESSAGE(STATUS " Boost lib path: ${Boost_LIBRARY_DIRS}") |
262 | - |
263 | - # Assume this is OK for the moment... |
264 | - SET (ZORBATEST_TESTDRIVER_MT_AVAILABLE TRUE) |
265 | - |
266 | - IF (Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION GREATER 34) |
267 | - # Boost 1.35 and above included a separate "system" component. In |
268 | - # at least some versions, filesystem depends on system - and the |
269 | - # Mac linker apparently does not figure this out. Therefore we |
270 | - # need to link it explicitly, which means we need to find it |
271 | - # first. |
272 | - FIND_PACKAGE(Boost COMPONENTS system) |
273 | - IF (NOT Boost_SYSTEM_FOUND) |
274 | - MESSAGE(STATUS "Did NOT find Boost SYSTEM component - not building multithreaded test driver") |
275 | - SET (ZORBATEST_TESTDRIVER_MT_AVAILABLE FALSE) |
276 | - ELSE (NOT Boost_SYSTEM_FOUND) |
277 | - SET (Boost_system_lib "boost_system-mt") |
278 | - ENDIF (NOT Boost_SYSTEM_FOUND) |
279 | - |
280 | - ENDIF (Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION GREATER 34) |
281 | - |
282 | -ENDIF (NOT Boost_FILESYSTEM_FOUND) |
283 | - |
284 | -IF (ZORBATEST_TESTDRIVER_MT_AVAILABLE) |
285 | - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) |
286 | - |
287 | - SET (TESTDRIVER_MT_SRCS |
288 | - testdriver_mt.cpp |
289 | - testdriver_common.cpp |
290 | - ${CMAKE_SOURCE_DIR}/test/commons/testdriver_comparator.cpp |
291 | - ${CMAKE_SOURCE_DIR}/test/commons/testuriresolver.cpp |
292 | - ) |
293 | - |
294 | - ZORBA_GENERATE_EXE( |
295 | - "testdriver_mt" "${TESTDRIVER_MT_SRCS}" "${Boost_LIBRARIES}" "" "") |
296 | - |
297 | - SET (ZORBATEST_USE_MT_XQTS NO CACHE BOOLEAN |
298 | - "If true, use testdriver_mt (when available) for running XQTS") |
299 | - MARK_AS_ADVANCED (ZORBATEST_USE_MT_XQTS) |
300 | - |
301 | -ENDIF (ZORBATEST_TESTDRIVER_MT_AVAILABLE) |
302 | - |
303 | # The NO_CTEST variable can be set to 1 so that CMake does not search |
304 | # for and add most of the Zorba tests, to speed up building and |
305 | # compiling the project. |
306 | |
307 | === removed directory 'test/rbkt/Documents' |
308 | === removed directory 'test/rbkt/Documents/test' |
309 | === removed file 'test/rbkt/Documents/test/bad1.xml' |
310 | === removed file 'test/rbkt/Documents/test/bad2.xml' |
311 | --- test/rbkt/Documents/test/bad2.xml 2013-02-07 17:24:36 +0000 |
312 | +++ test/rbkt/Documents/test/bad2.xml 1970-01-01 00:00:00 +0000 |
313 | @@ -1,3 +0,0 @@ |
314 | -<test:Plan xmlns:test='http://test.org/schema' |
315 | - <test:Case name='test1' emptyAttribute='' test:ns_id='auio'> |
316 | - </test:Case> |
317 | |
318 | === removed file 'test/rbkt/Documents/test/test1.xml' |
319 | --- test/rbkt/Documents/test/test1.xml 2013-02-07 17:24:36 +0000 |
320 | +++ test/rbkt/Documents/test/test1.xml 1970-01-01 00:00:00 +0000 |
321 | @@ -1,6 +0,0 @@ |
322 | -<?xml version="1.0" encoding="UTF-8"?> |
323 | -<test:Plan xmlns:test='http://test.org/schema'> |
324 | - <test:Case name='test1' emptyAttribute='' test:ns_id='auio'> |
325 | - </test:Case> |
326 | - <test:text>my name <b>is</b> foo</test:text> |
327 | -</test:Plan> |
328 | |
329 | === removed file 'test/rbkt/Documents/test/test2.xml' |
330 | --- test/rbkt/Documents/test/test2.xml 2013-02-07 17:24:36 +0000 |
331 | +++ test/rbkt/Documents/test/test2.xml 1970-01-01 00:00:00 +0000 |
332 | @@ -1,5 +0,0 @@ |
333 | -<test:Plan xmlns:test='http://test.org/schema'> |
334 | - <test:Case name='test1' emptyAttribute='' test:ns_id='auio'> |
335 | - </test:Case> |
336 | - <test:text>my name <b>is</b> foo</test:text> |
337 | -</test:Plan> |
338 | |
339 | === removed file 'test/rbkt/Documents/test/test3.xml' |
340 | --- test/rbkt/Documents/test/test3.xml 2013-02-07 17:24:36 +0000 |
341 | +++ test/rbkt/Documents/test/test3.xml 1970-01-01 00:00:00 +0000 |
342 | @@ -1,6 +0,0 @@ |
343 | -<?xml version="1.0" encoding="UTF-8"?> |
344 | -<test:Plan xmlns:test='http://test.org/schema'> |
345 | - <test:Case name='test1' emptyAttribute='' test:ns_id='auio'> |
346 | - </test:Case><!-- this is a comment --> |
347 | - <test:text>my name <b>is</b> <foo> and <![CDATA[this is some < & cdata>]]> </test:text> |
348 | -</test:Plan> |
349 | |
350 | === removed file 'test/rbkt/Documents/test/test4.xml' |
351 | --- test/rbkt/Documents/test/test4.xml 2013-02-07 17:24:36 +0000 |
352 | +++ test/rbkt/Documents/test/test4.xml 1970-01-01 00:00:00 +0000 |
353 | @@ -1,15 +0,0 @@ |
354 | -<?xml version="1.0" encoding="UTF-8"?> |
355 | -<plan> |
356 | - <test:Case xmlns:test='http://test.org/schema' name='test1' emptyAttribute='' test:ns_id='auio'> |
357 | - </test:Case><!-- this is a comment --> |
358 | - <test:text xmlns:test='http://test.org/schema2'>my name <b>is</b> foo></test:text> |
359 | - <text>this is some more text</text> |
360 | - <pre:foo xmlns:pre='http://test.org/pre1'> |
361 | - <pre:boo1/> |
362 | - <pre:boo2/> |
363 | - <pre:boo3> <goo1/> <goo2 xmlns:gg='http://test.org/schema3'/> </pre:boo3> |
364 | - <pre:boo4> |
365 | - <pre:goo3 xmlns:pre='http://test.org/pre2'/> |
366 | - </pre:boo4> |
367 | - </pre:foo> |
368 | -</plan> |
369 | |
370 | === removed directory 'test/rbkt/ExpLoaderResults' |
371 | === removed directory 'test/rbkt/ExpLoaderResults/test' |
372 | === removed file 'test/rbkt/ExpLoaderResults/test/test1.xml' |
373 | --- test/rbkt/ExpLoaderResults/test/test1.xml 2013-02-07 17:24:36 +0000 |
374 | +++ test/rbkt/ExpLoaderResults/test/test1.xml 1970-01-01 00:00:00 +0000 |
375 | @@ -1,8 +0,0 @@ |
376 | -<?xml version="1.0" encoding="UTF-8"?> |
377 | -<document baseUri = "" docUri = "zorba://internalDocumentURI-1"> |
378 | -<test:Plan nid="50 1.1" xmlns:test="http://test.org/schema"> |
379 | - <test:Case nid="5a 1.1.3" xmlns:test="http://test.org/schema" name="xs:untypedAtomic(test1)" emptyAttribute="xs:untypedAtomic()" test:ns_id="xs:untypedAtomic(auio)"> |
380 | - </test:Case> |
381 | - <test:text nid="5d80 1.1.7" xmlns:test="http://test.org/schema">my name <b nid="5dd0 1.1.7.3" xmlns:test="http://test.org/schema">is</b> foo</test:text> |
382 | -</test:Plan> |
383 | -</document> |
384 | |
385 | === removed file 'test/rbkt/ExpLoaderResults/test/test2.xml' |
386 | --- test/rbkt/ExpLoaderResults/test/test2.xml 2013-02-07 17:24:36 +0000 |
387 | +++ test/rbkt/ExpLoaderResults/test/test2.xml 1970-01-01 00:00:00 +0000 |
388 | @@ -1,8 +0,0 @@ |
389 | -<?xml version="1.0" encoding="UTF-8"?> |
390 | -<document baseUri = "" docUri = "zorba://internalDocumentURI-1"> |
391 | -<test:Plan nid="50 1.1" xmlns:test="http://test.org/schema"> |
392 | - <test:Case nid="5a 1.1.3" xmlns:test="http://test.org/schema" name="xs:untypedAtomic(test1)" emptyAttribute="xs:untypedAtomic()" test:ns_id="xs:untypedAtomic(auio)"> |
393 | - </test:Case> |
394 | - <test:text nid="5d80 1.1.7" xmlns:test="http://test.org/schema">my name <b nid="5dd0 1.1.7.3" xmlns:test="http://test.org/schema">is</b> foo</test:text> |
395 | -</test:Plan> |
396 | -</document> |
397 | |
398 | === removed file 'test/rbkt/ExpLoaderResults/test/test3.xml' |
399 | --- test/rbkt/ExpLoaderResults/test/test3.xml 2013-02-07 17:24:36 +0000 |
400 | +++ test/rbkt/ExpLoaderResults/test/test3.xml 1970-01-01 00:00:00 +0000 |
401 | @@ -1,8 +0,0 @@ |
402 | -<?xml version="1.0" encoding="UTF-8"?> |
403 | -<document baseUri = "" docUri = "zorba://internalDocumentURI-1"> |
404 | -<test:Plan nid="50 1.1" xmlns:test="http://test.org/schema"> |
405 | - <test:Case nid="5a 1.1.3" xmlns:test="http://test.org/schema" name="xs:untypedAtomic(test1)" emptyAttribute="xs:untypedAtomic()" test:ns_id="xs:untypedAtomic(auio)"> |
406 | - </test:Case><!-- this is a comment --> |
407 | - <test:text nid="5e10 1.1.9" xmlns:test="http://test.org/schema">my name <b nid="5e1a 1.1.9.3" xmlns:test="http://test.org/schema">is</b> <foo> and this is some < & cdata> </test:text> |
408 | -</test:Plan> |
409 | -</document> |
410 | |
411 | === removed file 'test/rbkt/ExpLoaderResults/test/test4.xml' |
412 | --- test/rbkt/ExpLoaderResults/test/test4.xml 2013-02-07 17:24:36 +0000 |
413 | +++ test/rbkt/ExpLoaderResults/test/test4.xml 1970-01-01 00:00:00 +0000 |
414 | @@ -1,17 +0,0 @@ |
415 | -<?xml version="1.0" encoding="UTF-8"?> |
416 | -<document baseUri = "" docUri = "zorba://internalDocumentURI-1"> |
417 | -<plan nid="50 1.1"> |
418 | - <test:Case nid="5a 1.1.3" xmlns:test="http://test.org/schema" name="xs:untypedAtomic(test1)" emptyAttribute="xs:untypedAtomic()" test:ns_id="xs:untypedAtomic(auio)"> |
419 | - </test:Case><!-- this is a comment --> |
420 | - <test:text nid="5e10 1.1.9" xmlns:test="http://test.org/schema2">my name <b nid="5e1a 1.1.9.3" xmlns:test="http://test.org/schema2">is</b> foo></test:text> |
421 | - <text nid="5e50 1.1.13">this is some more text</text> |
422 | - <pre:foo nid="5e90 1.1.17" xmlns:pre="http://test.org/pre1"> |
423 | - <pre:boo1 nid="5e9a 1.1.17.3" xmlns:pre="http://test.org/pre1"></pre:boo1> |
424 | - <pre:boo2 nid="5e9d80 1.1.17.7" xmlns:pre="http://test.org/pre1"></pre:boo2> |
425 | - <pre:boo3 nid="5e9e30 1.1.17.11" xmlns:pre="http://test.org/pre1"> <goo1 nid="5e9e3a 1.1.17.11.3" xmlns:pre="http://test.org/pre1"></goo1> <goo2 nid="5e9e3d80 1.1.17.11.7" xmlns:gg="http://test.org/schema3" xmlns:pre="http://test.org/pre1"></goo2> </pre:boo3> |
426 | - <pre:boo4 nid="5e9e70 1.1.17.15" xmlns:pre="http://test.org/pre1"> |
427 | - <pre:goo3 nid="5e9e7a 1.1.17.15.3" xmlns:pre="http://test.org/pre2"></pre:goo3> |
428 | - </pre:boo4> |
429 | - </pre:foo> |
430 | -</plan> |
431 | -</document> |
432 | |
433 | === modified file 'test/rbkt/Queries/CMakeLists.txt' |
434 | --- test/rbkt/Queries/CMakeLists.txt 2013-04-27 13:42:09 +0000 |
435 | +++ test/rbkt/Queries/CMakeLists.txt 2013-05-16 09:25:46 +0000 |
436 | @@ -124,6 +124,12 @@ |
437 | FIND_PACKAGE(CURL) |
438 | ENDIF(ZORBA_SUPPRESS_CURL) |
439 | |
440 | +# Set a flag if testdriver_mt was built |
441 | +IF (TARGET testdriver_mt) |
442 | + SET (_testdriver_mt_available 1) |
443 | +ELSE (TARGET testdriver_mt) |
444 | + SET (_testdriver_mt_available 0) |
445 | +ENDIF (TARGET testdriver_mt) |
446 | |
447 | FOREACH(TESTFILE ${TESTFILES}) |
448 | # All testfile paths end in .xq or .xqx. Strip that part off to form |
449 | @@ -161,14 +167,14 @@ |
450 | ENDIF(NOT ZORBA_WITH_JSON) |
451 | |
452 | IF (TESTNAME MATCHES "^test/rbkt/w3c_testsuite") |
453 | - IF (ZORBATEST_TESTDRIVER_MT_AVAILABLE AND ZORBATEST_USE_MT_XQTS) |
454 | + IF (_testdriver_mt_available AND ZORBATEST_USE_MT_XQTS) |
455 | # If this is an XQTS test and we want to use testdriver_mt instead, |
456 | # don't add the traditional testdriver version, but remember that |
457 | # we found some |
458 | SET (SKIP_TEST 1) |
459 | - ELSE (ZORBATEST_TESTDRIVER_MT_AVAILABLE AND ZORBATEST_USE_MT_XQTS) |
460 | + ELSE (_testdriver_mt_available AND ZORBATEST_USE_MT_XQTS) |
461 | SET (FOUND_XQTS 1) |
462 | - ENDIF (ZORBATEST_TESTDRIVER_MT_AVAILABLE AND ZORBATEST_USE_MT_XQTS) |
463 | + ENDIF (_testdriver_mt_available AND ZORBATEST_USE_MT_XQTS) |
464 | ENDIF (TESTNAME MATCHES "^test/rbkt/w3c_testsuite") |
465 | IF (ZORBA_NO_FULL_TEXT) |
466 | STRING(REGEX MATCH "fulltext/" NEEDS_FULL_TEXT "${TESTNAME}") |
467 | @@ -221,7 +227,7 @@ |
468 | |
469 | ENDFOREACH(TESTFILE) |
470 | |
471 | -IF (ZORBATEST_TESTDRIVER_MT_AVAILABLE AND ZORBATEST_USE_MT_XQTS AND |
472 | +IF (_testdriver_mt_available AND ZORBATEST_USE_MT_XQTS AND |
473 | IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/w3c_testsuite") |
474 | MESSAGE (STATUS "Adding multi-threaded XQTS test") |
475 | ZORBA_ADD_TEST(xqts-xquery testdriver_mt -q -b w3c_testsuite/XQuery |
476 | @@ -231,7 +237,7 @@ |
477 | ZORBA_ADD_TEST(xqts-xqx testdriver_mt -q -b w3c_testsuite/XQueryX |
478 | -k "${CMAKE_CURRENT_SOURCE_DIR}/w3c_known_failures_XQueryX.txt") |
479 | ENDIF (ZORBA_TEST_XQUERYX) |
480 | -ENDIF (ZORBATEST_TESTDRIVER_MT_AVAILABLE AND ZORBATEST_USE_MT_XQTS AND |
481 | +ENDIF (_testdriver_mt_available AND ZORBATEST_USE_MT_XQTS AND |
482 | IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/w3c_testsuite") |
483 | |
484 | SET(ZORBA_TEST_W3C_TO_SUBMIT_RESULTS OFF CACHE BOOL "Bool var that says if w3c testing results are to be submitted to w3c, or just for internal testing. If they are for internal testing then we can mark some failing tests as expected results.") |
485 | |
486 | === removed file 'test/rbkt/Scripts/CMakeLists.txt' |
487 | --- test/rbkt/Scripts/CMakeLists.txt 2013-02-07 17:24:36 +0000 |
488 | +++ test/rbkt/Scripts/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
489 | @@ -1,23 +0,0 @@ |
490 | -# Copyright 2006-2008 The FLWOR Foundation. |
491 | -# |
492 | -# Licensed under the Apache License, Version 2.0 (the "License"); |
493 | -# you may not use this file except in compliance with the License. |
494 | -# You may obtain a copy of the License at |
495 | -# |
496 | -# http://www.apache.org/licenses/LICENSE-2.0 |
497 | -# |
498 | -# Unless required by applicable law or agreed to in writing, software |
499 | -# distributed under the License is distributed on an "AS IS" BASIS, |
500 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
501 | -# See the License for the specific language governing permissions and |
502 | -# limitations under the License. |
503 | -SET(zorbaRepos ${CMAKE_SOURCE_DIR}) |
504 | -SET(zorbaExecDir ${CMAKE_BINARY_DIR}/test) |
505 | -SET(zorbaBuildDir ${CMAKE_BINARY_DIR} ) |
506 | -SET( zorbaVersion "${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER}" ) |
507 | - |
508 | -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/rbkt.sh.in ${CMAKE_CURRENT_BINARY_DIR}/rbkt.sh @ONLY) |
509 | - |
510 | -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/lbkt.sh.in ${CMAKE_CURRENT_BINARY_DIR}/lbkt.sh @ONLY) |
511 | - |
512 | -CONFIGURE_FILE ( ${CMAKE_CURRENT_SOURCE_DIR}/resultToXml.py.in ${CMAKE_CURRENT_BINARY_DIR}/resultToXml.py @ONLY ) |
513 | |
514 | === removed file 'test/rbkt/Scripts/cmp_ctest_logs' |
515 | --- test/rbkt/Scripts/cmp_ctest_logs 2013-02-07 17:24:36 +0000 |
516 | +++ test/rbkt/Scripts/cmp_ctest_logs 1970-01-01 00:00:00 +0000 |
517 | @@ -1,32 +0,0 @@ |
518 | -#!/bin/sh |
519 | -# Copyright 2006-2008 The FLWOR Foundation. |
520 | -# |
521 | -# Licensed under the Apache License, Version 2.0 (the "License"); |
522 | -# you may not use this file except in compliance with the License. |
523 | -# You may obtain a copy of the License at |
524 | -# |
525 | -# http://www.apache.org/licenses/LICENSE-2.0 |
526 | -# |
527 | -# Unless required by applicable law or agreed to in writing, software |
528 | -# distributed under the License is distributed on an "AS IS" BASIS, |
529 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
530 | -# See the License for the specific language governing permissions and |
531 | -# limitations under the License. |
532 | - |
533 | -if test "$#" != "2"; then |
534 | - echo Args: dir1/LastTestsFailed.log[.gz] dir2/LastTestsFailed.log[.gz] |
535 | - exit 1 |
536 | -fi |
537 | - |
538 | -TMP1=`mktemp /tmp/XXXXXX` |
539 | - |
540 | -mycat() |
541 | -{ |
542 | - if test "`basename $1 .gz`" != "`basename $1`"; then zcat $1; else cat $1; fi |
543 | -} |
544 | - |
545 | -mycat $2 | cut -f2 -d: | sort >$TMP1 |
546 | - |
547 | -mycat $1 | cut -f2 -d: | sort | diff -U0 $TMP1 - | tail -n +3 | egrep -v '^@' |
548 | - |
549 | -rm -f $TMP1 |
550 | |
551 | === removed file 'test/rbkt/Scripts/functions.sh' |
552 | --- test/rbkt/Scripts/functions.sh 2013-02-07 17:24:36 +0000 |
553 | +++ test/rbkt/Scripts/functions.sh 1970-01-01 00:00:00 +0000 |
554 | @@ -1,489 +0,0 @@ |
555 | -# Copyright 2006-2008 The FLWOR Foundation. |
556 | -# |
557 | -# Licensed under the Apache License, Version 2.0 (the "License"); |
558 | -# you may not use this file except in compliance with the License. |
559 | -# You may obtain a copy of the License at |
560 | -# |
561 | -# http://www.apache.org/licenses/LICENSE-2.0 |
562 | -# |
563 | -# Unless required by applicable law or agreed to in writing, software |
564 | -# distributed under the License is distributed on an "AS IS" BASIS, |
565 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
566 | -# See the License for the specific language governing permissions and |
567 | -# limitations under the License. |
568 | -#!/bin/bash |
569 | - |
570 | - |
571 | -################################################################################ |
572 | -# # |
573 | -# rbkt usage # |
574 | -# # |
575 | -################################################################################ |
576 | - |
577 | - |
578 | -function usage () |
579 | -{ |
580 | - echo "rbkt.sh [-b bucketName [-q queryName]] [-d displayFormat] [-h]" |
581 | - echo "or" |
582 | - echo "rbkt.sh [-b bucketName1 ... bucketNameN] [-d displayFormat] [-h]" |
583 | - echo |
584 | - echo "Run a single query, or all the queries inside a directory (bucket), or all" |
585 | - echo "the queries in a list of buckets, or all the queries that can be found" |
586 | - echo "anywhere inside the Queries dir." |
587 | - echo |
588 | - echo "Options : " |
589 | - echo |
590 | - echo "-b: Specifies the query bucket to run. <bucketName> is used to construct" |
591 | - echo " the full pathnames for the directories that contain a group of queries," |
592 | - echo " their expected results, and their actual results. For example, if" |
593 | - echo " bucketName is foo, rbkt will run queries in .../test/rbkt/Queries/foo" |
594 | - echo |
595 | - echo "-q: The query to run. The query string is in file <queryName>.xq inside" |
596 | - echo " the .../test/rbkt/Queries/<bucketName> directory." |
597 | - echo |
598 | - echo "-d: Specifies the display format for the query results. Currently, this" |
599 | - echo " may be one of xml or show. The default is xml" |
600 | - echo |
601 | - echo "-h : help" |
602 | -} |
603 | - |
604 | - |
605 | -################################################################################ |
606 | -# # |
607 | -# Test Directories # |
608 | -# # |
609 | -################################################################################ |
610 | - |
611 | -# |
612 | -# Function to check the existence of the required test dirs and to create |
613 | -# the results dir. |
614 | -# |
615 | -function buildDirEnv |
616 | -{ |
617 | - #echo; echo "buildDirEnv: Checking/Building Environment Directories" |
618 | - |
619 | - if [ ! -d ${zorbaRepos} ]; then |
620 | - echo "ERROR 5 buildDirEnv: zorba root directory ${sorbaRepos} does not exist" |
621 | - return 5 |
622 | - fi |
623 | - |
624 | - if [ ! -d ${testRootDir} ]; then |
625 | - echo "ERROR 10 buildDirEnv: test root directory ${testRootDir} does not exist" |
626 | - return 10 |
627 | - fi |
628 | - |
629 | - if [ ! -d $scriptsDir ]; then |
630 | - echo "ERROR 14 buildDirEnv: test scripts directory $scriptsDir does not exist" |
631 | - return 14 |
632 | - fi |
633 | - |
634 | - if [ ! -d ${queriesDir} ]; then |
635 | - echo "ERROR 12 buildDirEnv: queries directory ${queriesDir} does not exist" |
636 | - return 12 |
637 | - fi |
638 | - if [ ! -d ${expQueryResultsDir} ]; then |
639 | - echo "ERROR 13 buildDirEnv: expected results directory ${expQueryResultsDir} does not exist" |
640 | - return 13 |
641 | - fi |
642 | - |
643 | - mkdir -p ${queryResultsDir} |
644 | - |
645 | - if [ ! -d ${docsDir} ]; then |
646 | - echo "ERROR 12 buildDirEnv: source docs directory ${docsDir} does not exist" |
647 | - return 12 |
648 | - fi |
649 | - if [ ! -d ${expLoaderResultsDir} ]; then |
650 | - echo "ERROR 13 buildDirEnv: expected docs directory ${expLoaderResultsDir} does not exist" |
651 | - return 13 |
652 | - fi |
653 | - |
654 | - mkdir -p ${loaderResultsDir} |
655 | - |
656 | - return 0 |
657 | -} |
658 | - |
659 | - |
660 | -################################################################################ |
661 | -# # |
662 | -# Running Queries # |
663 | -# # |
664 | -################################################################################ |
665 | - |
666 | - |
667 | -# |
668 | -# params: |
669 | -# |
670 | -# $1 queryFile |
671 | -# $2 querySpecFile |
672 | -# $3 displayFormat |
673 | -# |
674 | -function run_query |
675 | -{ |
676 | - local queryFile="$1" |
677 | - local querySpecFile="$2" |
678 | - local displayFormat=$3 |
679 | - |
680 | - local error=0 |
681 | - |
682 | - local EXE=${zorbaExecDir}/apitest |
683 | - |
684 | - if [ ! -e "${EXE}" ]; then |
685 | - echo "ERROR 1 run_query: binary executable ${EXE} not found" |
686 | - exit 17 |
687 | - fi |
688 | - |
689 | - cd ${queryFile%/*} |
690 | - |
691 | - #echo "queryFile = ${queryFile}" |
692 | - #echo "querySpecFile = ${querySpecFile}" |
693 | - |
694 | - if test -f $querySpecFile; then |
695 | - XARGS=`egrep ^Args: ${querySpecFile} | cut -f2- -d:` |
696 | - ERRS=`egrep ^Error: ${querySpecFile} | cut -f2- -d:` |
697 | - else |
698 | - XARGS="" |
699 | - ERRS="" |
700 | - fi |
701 | - |
702 | - #echo "XARGS = ${XARGS}" |
703 | - |
704 | - SEDARG=`echo ${testRootDir} | sed -r 's/\//\\\\\//g'` |
705 | - |
706 | - echo "s/\$RBKT_SRC_DIR/$SEDARG/g" > sedargs |
707 | - |
708 | - XARGS=`echo ${XARGS} | sed -f sedargs` |
709 | - |
710 | - rm sedargs |
711 | - |
712 | - if [ $displayFormat == "xml" ]; then |
713 | - #echo "${EXE} ${XARGS} -r -o ${queryFile}.res ${queryFile} 2> ${queryFile}.err" |
714 | - ${EXE} ${XARGS} -r -o "${queryFile}.res" "${queryFile}" 2> ${queryFile}.err |
715 | - else |
716 | - ${EXE} -o "${queryFile}.res" "${queryFile}" 2> "${queryFile}.err" |
717 | - fi |
718 | - error=$? |
719 | - if [ ${error} != 0 ]; then |
720 | - echo "ERROR 2 run_query: ${EXE} $1 failed with error code ${error}" |
721 | - # To allow more queries to be run by the caller, do not propagate error |
722 | - fi |
723 | - |
724 | - cd - >/dev/null |
725 | - |
726 | - return 0 |
727 | -} |
728 | - |
729 | - |
730 | -# |
731 | -# params |
732 | -# |
733 | -# $1 bucketName |
734 | -# $2 queryName |
735 | -# $3 displayFormat |
736 | -# |
737 | -function run_query_in_bucket |
738 | -{ |
739 | - local bucketName="$1" |
740 | - local queryName="$2" |
741 | - local displayFormat=$3 |
742 | - |
743 | - local error=0 |
744 | - |
745 | - local inputDir="${queriesDir}/${bucketName}" |
746 | - local queryFile="${inputDir}/${queryName}.xq" |
747 | - local querySpec="${inputDir}/${queryName}.spec" |
748 | - |
749 | - local expResultsDir="${expQueryResultsDir}/${bucketName}" |
750 | - local fmtExt="" |
751 | - if [ $displayFormat == "xml" ]; then |
752 | - fmtExt="xml" |
753 | - else |
754 | - fmtExt="show" |
755 | - fi |
756 | - local expResultFile="${expResultsDir}/${queryName}.${fmtExt}.res" |
757 | - |
758 | - local resultsDir="${queryResultsDir}/${bucketName}" |
759 | - local resultFile="${resultsDir}/${queryName}.${fmtExt}.res" |
760 | - local errorsFile="${resultsDir}/${queryName}.${fmtExt}.err" |
761 | - local diffFile="${resultsDir}/${queryName}.${fmtExt}.diff" |
762 | - |
763 | - if [ ! -e "${queryFile}" ]; then |
764 | - echo "ERROR 1 run_query_in_bucket: query file ${queryFile} does not exist" |
765 | - return 17 |
766 | - fi |
767 | - |
768 | - # |
769 | - # Create results directory, if it doesn't exist already. |
770 | - # If it exists, then clean it up. |
771 | - # |
772 | - mkdir -p "${resultsDir}" |
773 | - if [ $? != 0 ]; then echo "ERROR 2 run_query_in_bucket: mkdir -p failed"; exit 19; fi |
774 | - rm -f "${resultDir}"/${queryName}.* |
775 | - |
776 | - # |
777 | - # Run the query |
778 | - # |
779 | - run_query "${queryFile}" "${querySpec}" ${displayFormat} |
780 | - error=$? |
781 | - if [ ${error} != 0 ]; then |
782 | - echo "ERROR 3 run_query_in_bucket: run_query failed with error code ${error}" |
783 | - return ${error} |
784 | - fi |
785 | - |
786 | - # |
787 | - # apitest creates the result file in the same dir as the query file. |
788 | - # So, we must move the result file to the result dir. |
789 | - # |
790 | - # If no result file was generated, then we create an empty one. |
791 | - # |
792 | - if [ -s "${inputDir}/${queryName}.xq.res.err" ]; then |
793 | - cat "${inputDir}/${queryName}.xq.res.err" | head -1 | cut -f1 -d':' > "${inputDir}/${queryName}.xq.res" |
794 | - fi |
795 | - |
796 | - mkdir -p `dirname ${resultFile}` |
797 | - if [ -e "${inputDir}/${queryName}.xq.res" ]; then |
798 | - mv "${inputDir}/${queryName}.xq.res" "${resultFile}" |
799 | - if [ ! -f "${resultFile}" ]; then |
800 | - echo "ERROR 12 run_query_in_bucket: could not create output file"; exit 19; |
801 | - fi |
802 | - else |
803 | - touch "${resultFile}" |
804 | - if [ $? != 0 ]; then |
805 | - echo "ERROR 13 run_query_in_bucket: touch failed"; exit 19; |
806 | - fi |
807 | - fi |
808 | - |
809 | - if [ -e "${inputDir}/${queryName}.xq.err" ]; then |
810 | - mv "${inputDir}/${queryName}.xq.err" ${errorsFile} |
811 | - fi |
812 | - |
813 | - # |
814 | - # Do the diffs |
815 | - # |
816 | - if [ -e "${expResultFile}" ]; then |
817 | - cat "${expResultFile}" | diff -I '^Duration.*:' "${resultFile}" - > "${diffFile}" |
818 | - #cat "${expResultFile}" | diff -I '^Duration.*:' "${resultFile}" - > "${diffFile}" |
819 | - else |
820 | - echo "Missing expected results for ${queryName}" |
821 | - cp "${queryFile}" "${diffFile}" |
822 | - if [ $? != 0 ]; then echo "ERROR 21 run_query_in_bucket: cp failed"; exit 19; fi |
823 | - fi |
824 | - |
825 | - if [ -s "${diffFile}" ]; then |
826 | - echo "FAILURE: ${bucketName} / ${queryName}" |
827 | - echo |
828 | - echo >> rbkt_summary.txt |
829 | - echo "FAILURE : -bucket ${bucketName} -query ${queryName}" >> rbkt_summary.txt |
830 | - echo >> rbkt_summary.txt |
831 | - let failedQueries=failedQueries+1 |
832 | - else |
833 | - echo "SUCCESS: ${bucketName} / ${queryName}" |
834 | - echo |
835 | - fi |
836 | - |
837 | - let totalQueries=totalQueries+1 |
838 | - |
839 | - return 0 |
840 | -} |
841 | - |
842 | - |
843 | -# |
844 | -# params: |
845 | -# |
846 | -# $1 bucketName |
847 | -# $2 displayFormat |
848 | -# |
849 | -function run_bucket() |
850 | -{ |
851 | - local bucketName="$1" |
852 | - local displayFormat=$2 |
853 | - local error=0 |
854 | - local queryList="" |
855 | - local q="" |
856 | - local queryName="" |
857 | - |
858 | - if [ ! -e "${queriesDir}/${bucketName}" ]; then |
859 | - echo "ERROR 1 run_bucket: bucket ${queriesDir}/${bucketName} does not exist" |
860 | - return 17 |
861 | - fi |
862 | - |
863 | - queryList=`mktemp` |
864 | - (cd "${queriesDir}/${bucketName}"; find . -name '*.xq' | cut -f2- -d/ ) > $queryList |
865 | - |
866 | - # Uses fd 3 for reading queries. |
867 | - # Nasty, but remember there can be many queries, and redirection |
868 | - # applies for the entire while loop. |
869 | - while read -u3 q; do |
870 | - queryName=`echo $q | sed -e 's/.xq$//g'` |
871 | - run_query_in_bucket "${bucketName}" "${queryName}" ${displayFormat} |
872 | - error=$? |
873 | - if [ ${error} != 0 ]; then |
874 | - echo "ERROR 3 run_bucket: run_bucket failed with error code ${error}" |
875 | - return ${error} |
876 | - fi |
877 | - done 3< $queryList |
878 | - |
879 | - rm -f $queryList |
880 | - |
881 | - return 0 |
882 | -} |
883 | - |
884 | - |
885 | -################################################################################ |
886 | -# # |
887 | -# Loading Docs # |
888 | -# # |
889 | -################################################################################ |
890 | - |
891 | - |
892 | -# |
893 | -# $1 - docFile : Full pathname of the file that contains the document text |
894 | -# |
895 | -function load_doc |
896 | -{ |
897 | - local error=0 |
898 | - |
899 | - local docFile="$1" |
900 | - |
901 | - local EXE=${zorbaExecDir}/test_store |
902 | - |
903 | - if [ ! -e "${EXE}" ]; then |
904 | - echo "ERROR 1 load_doc: binary executable ${EXE} not found" |
905 | - exit 17 |
906 | - fi |
907 | - |
908 | - ${EXE} "${docFile}" |
909 | - error=$? |
910 | - if [ ${error} != 0 ]; then |
911 | - echo "ERROR 2 load_doc: ${EXE} $1 failed with error code ${error}" |
912 | - # To allow more docs to be loaded by the caller, do not propagate error |
913 | - fi |
914 | - |
915 | - return 0 |
916 | -} |
917 | - |
918 | - |
919 | -# |
920 | -# $1 bucketName : See load_bucket() function |
921 | -# $2 docName : The doc name. |
922 | -# |
923 | -function load_doc_in_bucket() |
924 | -{ |
925 | - local error=0 |
926 | - |
927 | - local bucketName="$1" |
928 | - local docName="$2" |
929 | - |
930 | - local inputDir="${docsDir}/${bucketName}" |
931 | - local docFile="${inputDir}/${docName}.xml" |
932 | - |
933 | - local expResultsDir="${expLoaderResultsDir}/${bucketName}" |
934 | - local expResultFile="${expResultsDir}/${docName}.xml" |
935 | - |
936 | - local resultsDir="${loaderResultsDir}/${bucketName}" |
937 | - local resultFile="${resultsDir}/${docName}.xml" |
938 | - local diffFile="${resultsDir}/${docName}.diff" |
939 | - |
940 | - if [ ! -e "${docFile}" ]; then |
941 | - echo "ERROR 1 load_doc_in_bucket: doc file ${docFile} does not exist" |
942 | - return 17 |
943 | - fi |
944 | - |
945 | - # |
946 | - # Create results directory, if it doesn't exist already. |
947 | - # If it exists, then clean it up. |
948 | - # |
949 | - mkdir -p "${resultsDir}" |
950 | - if [ $? != 0 ]; then echo "ERROR 2 load_doc_in_bucket: mkdir -p failed"; exit 19; fi |
951 | - rm -f "${resultsDir}"/${docName}.* |
952 | - |
953 | - # |
954 | - # Load the doc |
955 | - # |
956 | - load_doc "${docFile}" |
957 | - error=$? |
958 | - if [ ${error} != 0 ]; then |
959 | - echo "ERROR 3 load_doc_in_bucket: load_doc failed with error code ${error}" |
960 | - return ${error} |
961 | - fi |
962 | - |
963 | - # |
964 | - # test_store creates the result file in the same dir as the doc file. |
965 | - # So, we must move the result file to the result dir. |
966 | - # |
967 | - # If no result file was generated, then we create an empty one. |
968 | - # |
969 | - if [ -e "${inputDir}/${docName}.xml.res" ]; then |
970 | - mv "${inputDir}/${docName}.xml.res" "${resultFile}" |
971 | - if [ $? != 0 ]; then echo "ERROR 12 load_doc_in_bucket: mv failed"; exit 19; fi |
972 | - else |
973 | - touch "${resultFile}" |
974 | - if [ $? != 0 ]; then echo "ERROR 13 load_doc_in_bucket: touch failed"; exit 19; fi |
975 | - fi |
976 | - |
977 | - # |
978 | - # Do the diffs |
979 | - # |
980 | - if [ -e "${expResultFile}" ]; then |
981 | - diff "${resultFile}" "${expResultFile}" > "${diffFile}" |
982 | - else |
983 | - echo "Missing expected results for ${docName}" |
984 | - cp "${docFile}" "${diffFile}" |
985 | - if [ $? != 0 ]; then echo "ERROR 21 load_doc_in_bucket: cp failed"; exit 19; fi |
986 | - fi |
987 | - |
988 | - if [ -s "${diffFile}" ]; then |
989 | - echo |
990 | - echo "FAILURE : -bucket ${bucketName} -doc ${docName}" |
991 | - echo |
992 | - let failedDocs=failedDocs+1 |
993 | - else |
994 | - echo |
995 | - echo "SUCCESS : -bucket ${bucketName} -doc ${docName}" |
996 | - echo |
997 | - fi |
998 | - |
999 | - let totalDocs=totalDocs+1 |
1000 | - |
1001 | - return 0 |
1002 | -} |
1003 | - |
1004 | - |
1005 | -# |
1006 | -# params: |
1007 | -# |
1008 | -# $1 bucketName |
1009 | -# |
1010 | -function load_bucket() |
1011 | -{ |
1012 | - local error=0 |
1013 | - local docList="" |
1014 | - local d="" |
1015 | - local docName="" |
1016 | - local bucketName="$1" |
1017 | - |
1018 | - if [ ! -e "${docsDir}/${bucketName}" ]; then |
1019 | - echo "ERROR 1 load_bucket: bucket ${docsDir}/${bucketName} does not exist" |
1020 | - return 17 |
1021 | - fi |
1022 | - |
1023 | - cd "${docsDir}/${bucketName}" |
1024 | - docList=`ls *.xml` |
1025 | - cd - >/dev/null |
1026 | - |
1027 | - for d in $docList |
1028 | - do |
1029 | - echo ${d} | sed -e s/".xml"/""/g > tmp_docFile |
1030 | - for docName in `cat tmp_docFile` |
1031 | - do |
1032 | - load_doc_in_bucket "${bucketName}" "${docName}" |
1033 | - error=$? |
1034 | - if [ ${error} != 0 ]; then |
1035 | - echo "ERROR 3 load_bucket: load_bucket failed with error code ${error}" |
1036 | - return ${error} |
1037 | - fi |
1038 | - done |
1039 | - rm -f tmp_docFile |
1040 | - done |
1041 | - |
1042 | - return 0 |
1043 | -} |
1044 | |
1045 | === removed file 'test/rbkt/Scripts/lbkt.sh.in' |
1046 | --- test/rbkt/Scripts/lbkt.sh.in 2013-02-07 17:24:36 +0000 |
1047 | +++ test/rbkt/Scripts/lbkt.sh.in 1970-01-01 00:00:00 +0000 |
1048 | @@ -1,170 +0,0 @@ |
1049 | -#!/bin/bash |
1050 | -# Copyright 2006-2008 The FLWOR Foundation. |
1051 | -# |
1052 | -# Licensed under the Apache License, Version 2.0 (the "License"); |
1053 | -# you may not use this file except in compliance with the License. |
1054 | -# You may obtain a copy of the License at |
1055 | -# |
1056 | -# http://www.apache.org/licenses/LICENSE-2.0 |
1057 | -# |
1058 | -# Unless required by applicable law or agreed to in writing, software |
1059 | -# distributed under the License is distributed on an "AS IS" BASIS, |
1060 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1061 | -# See the License for the specific language governing permissions and |
1062 | -# limitations under the License. |
1063 | - |
1064 | -zorbaRepos=@zorbaRepos@ |
1065 | -zorbaExecDir=@zorbaExecDir@ |
1066 | - |
1067 | -error=0 |
1068 | - |
1069 | -# |
1070 | -# The environment variable zorbaRepos must be defined. It should point to a |
1071 | -# directory containing a zorba source repository (e.g., /home/markos/zorba/xquery) |
1072 | -# |
1073 | -if [ ! ${zorbaRepos} ]; then |
1074 | - echo "ERROR 1 lbkt.sh: zorbaRepos environment variable is not set" |
1075 | - exit 1 |
1076 | -fi |
1077 | - |
1078 | - |
1079 | -# |
1080 | -# The environment variable zorbaExeDir must be defined. It must be set to the |
1081 | -# full pathname of the directory containig all the test executables |
1082 | -# |
1083 | -if [ ! ${zorbaExecDir} ]; then |
1084 | - echo "ERROR 1 lbkt.sh: zorbaExecDir environment variable is not set" |
1085 | - exit 1 |
1086 | -fi |
1087 | - |
1088 | -# |
1089 | -# testRootDir is the root directory of the test environment. It contains the |
1090 | -# the scripts, the test queries and their expected results, and the source docs |
1091 | -# to be loaded. It is also under this directory where all output from the tests |
1092 | -# is stored. |
1093 | -# |
1094 | -testRootDir=${zorbaRepos}/test/rbkt |
1095 | - |
1096 | -# The following dirs MUST exist under the testRootDir. |
1097 | -scriptsDir=${testRootDir}/Scripts |
1098 | -queriesDir=${testRootDir}/Queries |
1099 | -expQueryResultsDir=${testRootDir}/ExpQueryResults |
1100 | -docsDir=${testRootDir}/Documents |
1101 | -expLoaderResultsDir=${testRootDir}/ExpLoaderResults |
1102 | - |
1103 | -# This is the dir where all query results are stored. This dir is created |
1104 | -# by the buildDirEnv function, if it does not exist already. |
1105 | -queryResultsDir=${testRootDir}/QueryResults |
1106 | - |
1107 | -# This is the dir where all loader results are stored. This dir is created |
1108 | -# by the buildDirEnv function, if it does not exist already. |
1109 | -loaderResultsDir=${testRootDir}/LoaderResults |
1110 | - |
1111 | - |
1112 | -# |
1113 | -# sourcing of common functions |
1114 | -# |
1115 | -if [ ! -e ${scriptsDir}/functions.sh ]; then |
1116 | - echo "ERROR 3 lbkt.sh: ${scriptsDir}/functions.sh does not exist" |
1117 | - exit 3 |
1118 | -fi |
1119 | - |
1120 | -source ${scriptsDir}/functions.sh |
1121 | - |
1122 | -trap '' 12 |
1123 | - |
1124 | -# |
1125 | -# Argument parsing |
1126 | -# |
1127 | -bucketName="" |
1128 | -docName="" |
1129 | - |
1130 | -state=0 |
1131 | -while [ $1 ] |
1132 | -do |
1133 | - case $1 in |
1134 | - -b) state=1;; |
1135 | - -d) state=2;; |
1136 | - -h) usage ; exit;; |
1137 | - *) case $state in |
1138 | - 1) bucketName="$1"; state=0 ;; |
1139 | - 2) docName="$1"; state=0 ;; |
1140 | - *) echo "ERROR 6 lbkt.sh: Wrong parameter $1"; usage; exit 6;; |
1141 | - esac ;; |
1142 | - esac |
1143 | - shift |
1144 | -done |
1145 | - |
1146 | -if [ $state -ne 0 ]; then |
1147 | - echo "ERROR 7 lbkt.sh: Wrong arg list"; usage; exit 7; |
1148 | -fi |
1149 | - |
1150 | - |
1151 | -# |
1152 | -# Building env directories and runtime env |
1153 | -# |
1154 | -buildDirEnv |
1155 | -error=$? |
1156 | -if [ ${error} -ne 0 ]; then |
1157 | - echo "ERROR 10 lbkt.sh: buildDirEnv function failed with error code ${error}" |
1158 | - exit ${error} |
1159 | -fi |
1160 | - |
1161 | - |
1162 | -# |
1163 | -# Load queries |
1164 | -# |
1165 | -#echo; echo "Loading Queries" |
1166 | -failedDocs=0 |
1167 | -totalDocss=0 |
1168 | - |
1169 | -rm -f lbkt_summary.txt |
1170 | - |
1171 | -if [ "${bucketName}" != "" ]; then |
1172 | - |
1173 | - if [ "${docName}" != "" ]; then |
1174 | - load_doc_in_bucket "${bucketName}" "${docName}" |
1175 | - error=$? |
1176 | - if [ ${error} -ne 0 ]; then |
1177 | - echo "ERROR 70 lbkt.sh: load_doc_in_bucket function failed with error code ${error}" |
1178 | - exit ${error} |
1179 | - fi |
1180 | - else |
1181 | - echo; echo "Loading bucket ${bucketName}" |
1182 | - load_bucket "${bucketName}" |
1183 | - error=$? |
1184 | - if [ ${error} -ne 0 ]; then |
1185 | - echo "ERROR 71 lbkt.sh: run_bucket function failed with error code ${error}" |
1186 | - exit ${error} |
1187 | - fi |
1188 | - fi |
1189 | - |
1190 | -else |
1191 | - #bucketList=`find "${queriesSDir}" -mindepth 1 -type d -printf "%f\n"` |
1192 | - bucketList="test" |
1193 | - |
1194 | - for bucketName in ${bucketList} |
1195 | - do |
1196 | - echo; echo "Running bucket ${bucketName}" |
1197 | - load_bucket "${bucketName}" |
1198 | - error=$? |
1199 | - if [ ${error} -ne 0 ]; then |
1200 | - echo "ERROR 72 lbkt.sh: run_bucket function failed with error code ${error}" |
1201 | - exit ${error} |
1202 | - fi |
1203 | - done |
1204 | -fi |
1205 | - |
1206 | -echo |
1207 | -echo "lbkt.sh : total number of docs = $totalDocs" |
1208 | -echo "lbkt.sh : number of failed docs = $failedDocs" |
1209 | - |
1210 | -echo >> lbkt_summary.txt |
1211 | -echo "lbkt.sh : total number of docs = $totalDocs" >> lbkt_summary.txt |
1212 | -echo "lbkt.sh : number of failed docs = $failedDocs" >> lbkt_summary.txt |
1213 | - |
1214 | -if [ ${failedDocs} -gt 0 ]; then |
1215 | - exit 1 |
1216 | -else |
1217 | - exit 0 |
1218 | -fi |
1219 | |
1220 | === removed file 'test/rbkt/Scripts/rbkt.sh.in' |
1221 | --- test/rbkt/Scripts/rbkt.sh.in 2013-02-07 17:24:36 +0000 |
1222 | +++ test/rbkt/Scripts/rbkt.sh.in 1970-01-01 00:00:00 +0000 |
1223 | @@ -1,205 +0,0 @@ |
1224 | -#!/bin/bash |
1225 | -# Copyright 2006-2008 The FLWOR Foundation. |
1226 | -# |
1227 | -# Licensed under the Apache License, Version 2.0 (the "License"); |
1228 | -# you may not use this file except in compliance with the License. |
1229 | -# You may obtain a copy of the License at |
1230 | -# |
1231 | -# http://www.apache.org/licenses/LICENSE-2.0 |
1232 | -# |
1233 | -# Unless required by applicable law or agreed to in writing, software |
1234 | -# distributed under the License is distributed on an "AS IS" BASIS, |
1235 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1236 | -# See the License for the specific language governing permissions and |
1237 | -# limitations under the License. |
1238 | - |
1239 | -error=0 |
1240 | - |
1241 | -zorbaRepos=@zorbaRepos@ |
1242 | -zorbaExecDir=@zorbaExecDir@ |
1243 | - |
1244 | -# |
1245 | -# The environment variable zorbaRepos must be defined. It should point to a |
1246 | -# directory containing a zorba source repository (e.g., /home/markos/zorba/xquery) |
1247 | -# |
1248 | -if [ ! ${zorbaRepos} ]; then |
1249 | - echo "ERROR 1 rbkt.sh: zorbaRepos environment variable is not set" |
1250 | - exit 1 |
1251 | -fi |
1252 | - |
1253 | - |
1254 | -# |
1255 | -# The environment variable zorbaExe must be defined. It must be set to the |
1256 | -# full pathname of the query_exec executable |
1257 | -# |
1258 | -if [ ! ${zorbaExecDir} ]; then |
1259 | - echo "ERROR 1 rbkt.sh: zorbaExecDir environment variable is not set" |
1260 | - exit 1 |
1261 | -fi |
1262 | - |
1263 | -# |
1264 | -# testRootDir is the root directory of the test environment. It contains the |
1265 | -# the scripts, the test queries and their expected results. It is also under |
1266 | -# this directory where all output from the tests is stored. |
1267 | -# |
1268 | -testRootDir="${zorbaRepos}/test/rbkt" |
1269 | - |
1270 | -# The following dirs MUST exist under the testRootDir. |
1271 | -scriptsDir=${testRootDir}/Scripts |
1272 | - |
1273 | -queriesDir=${testRootDir}/Queries |
1274 | -expQueryResultsDir=${testRootDir}/ExpQueryResults |
1275 | -docsDir=${testRootDir}/Documents |
1276 | -expLoaderResultsDir=${testRootDir}/ExpLoaderResults |
1277 | - |
1278 | -# This is the dir where all query results are stored. This dir is created |
1279 | -# by the buildDirEnv function, if it does not exist already. |
1280 | -queryResultsDir=${testRootDir}/QueryResults |
1281 | - |
1282 | -# This is the dir where all loader results are stored. This dir is created |
1283 | -# by the buildDirEnv function, if it does not exist already. |
1284 | -loaderResultsDir=${testRootDir}/LoaderResults |
1285 | - |
1286 | - |
1287 | -# |
1288 | -# sourcing of common functions |
1289 | -# |
1290 | -if [ ! -e ${scriptsDir}/functions.sh ]; then |
1291 | - echo "ERROR 3 rbkt.sh: ${scriptsDir}/functions.sh does not exist" |
1292 | - exit 3 |
1293 | -fi |
1294 | - |
1295 | -source ${scriptsDir}/functions.sh |
1296 | - |
1297 | -trap '' 12 |
1298 | - |
1299 | -# |
1300 | -# Argument parsing |
1301 | -# |
1302 | -bucketList="" |
1303 | -bucketName="" |
1304 | -numBuckets=0 |
1305 | -queryName="" |
1306 | -displayFormat="xml" |
1307 | - |
1308 | -state=0 |
1309 | -while [ $1 ] |
1310 | -do |
1311 | - case $1 in |
1312 | - -b) state=1;; |
1313 | - |
1314 | - -q) if [ $state -eq 0 -o $state -eq 1 -a $numBuckets -eq 1 ]; then |
1315 | - state=2; |
1316 | - else |
1317 | - echo "ERROR 5 rbkt.sh: Wrong option -q"; usage; exit 5; |
1318 | - fi ;; |
1319 | - |
1320 | - -d) state=3;; |
1321 | - |
1322 | - -h) usage ; exit;; |
1323 | - |
1324 | - *) case $state in |
1325 | - |
1326 | - 1) if [ $numBuckets -eq 0 ]; then |
1327 | - bucketList="$1" |
1328 | - else |
1329 | - bucketList="${bucketList} $1"; |
1330 | - fi |
1331 | - let numBuckets=$numBuckets+1 ;; |
1332 | - |
1333 | - 2) queryName="$1"; state=0 ;; |
1334 | - |
1335 | - 3) displayFormat="$1"; state=0 ;; |
1336 | - |
1337 | - *) echo "ERROR 6 rbkt.sh: Wrong parameter $1"; usage; exit 6;; |
1338 | - esac ;; |
1339 | - esac |
1340 | - shift |
1341 | -done |
1342 | - |
1343 | -if [ $numBuckets -eq 1 ]; then |
1344 | - bucketName=$bucketList |
1345 | -fi |
1346 | - |
1347 | -if [ $state -ne 0 -a $state -ne 1 ]; then |
1348 | - echo "ERROR 7 rbkt.sh: Wrong arg list"; usage; exit 7; |
1349 | -fi |
1350 | - |
1351 | -if [ ${displayFormat} != "xml" -a ${displayFormat} != "show" ]; then |
1352 | - echo "ERROR 8 rbkt.sh: Wrong display format; must be xml or show"; exit 8; |
1353 | -fi |
1354 | - |
1355 | -# |
1356 | -# Building env directories and runtime env |
1357 | -# |
1358 | -buildDirEnv |
1359 | -error=$? |
1360 | -if [ ${error} -ne 0 ]; then |
1361 | - echo "ERROR 10 rbkt.sh: buildDirEnv function failed with error code ${error}" |
1362 | - exit ${error} |
1363 | -fi |
1364 | - |
1365 | - |
1366 | -# |
1367 | -# Run queries |
1368 | -# |
1369 | -#echo; echo "Running Queries" |
1370 | -failedQueries=0 |
1371 | -totalQueries=0 |
1372 | - |
1373 | -rm -f rbkt_summary.txt |
1374 | - |
1375 | -if [ "${bucketName}" != "" ]; then |
1376 | - |
1377 | - if [ "${queryName}" != "" ]; then |
1378 | - run_query_in_bucket "${bucketName}" "${queryName}" ${displayFormat} |
1379 | - error=$? |
1380 | - if [ ${error} -ne 0 ]; then |
1381 | - echo "ERROR 70 rbkt.sh: run_query_in_bucket function failed with error code ${error}" |
1382 | - exit ${error} |
1383 | - fi |
1384 | - else |
1385 | - echo; echo "Running bucket ${bucketName}" |
1386 | - run_bucket "${bucketName}" ${displayFormat} |
1387 | - error=$? |
1388 | - if [ ${error} -ne 0 ]; then |
1389 | - echo "ERROR 71 rbkt.sh: run_bucket function failed with error code ${error}" |
1390 | - exit ${error} |
1391 | - fi |
1392 | - fi |
1393 | - |
1394 | -else |
1395 | - if [ -z "${bucketList}" ]; then |
1396 | - # bugfix by Matthias (collect the buckets automatically) |
1397 | - bucketList=`find "${queriesDir}" -type d -maxdepth 1 ! -name '.svn' ! -name '.' ! -name 'Queries' -exec basename {} \;` |
1398 | - fi |
1399 | - |
1400 | - echo "bucketList = $bucketList" |
1401 | - |
1402 | - for bucketName in ${bucketList} |
1403 | - do |
1404 | - echo; echo "Running bucket ${bucketName}" |
1405 | - run_bucket "${bucketName}" ${displayFormat} |
1406 | - error=$? |
1407 | - if [ ${error} -ne 0 ]; then |
1408 | - echo "ERROR 72 rbkt.sh: run_bucket function failed with error code ${error}" |
1409 | - exit ${error} |
1410 | - fi |
1411 | - done |
1412 | -fi |
1413 | - |
1414 | -echo |
1415 | -echo "rbkt.sh : total number of queries = $totalQueries" |
1416 | -echo "rbkt.sh : number of failed queries = $failedQueries" |
1417 | - |
1418 | -echo >> rbkt_summary.txt |
1419 | -echo "rbkt.sh : number of failed queries = $failedQueries" >> rbkt_summary.txt |
1420 | - |
1421 | -rm -f query.dot |
1422 | -rm -f query.xml |
1423 | - |
1424 | -if [ ${failedQueries} -gt 0 ]; then |
1425 | - exit 1 |
1426 | -else |
1427 | - exit 0 |
1428 | -fi |
1429 | |
1430 | === removed file 'test/rbkt/Scripts/resultToXml.py.in' |
1431 | --- test/rbkt/Scripts/resultToXml.py.in 2013-02-07 17:24:36 +0000 |
1432 | +++ test/rbkt/Scripts/resultToXml.py.in 1970-01-01 00:00:00 +0000 |
1433 | @@ -1,88 +0,0 @@ |
1434 | -#!/usr/bin/python |
1435 | - |
1436 | -""" Copyright 2009 The FLWOR Foundation. |
1437 | - |
1438 | - Licensed under the Apache License, Version 2.0 (the "License"); |
1439 | - you may not use this file except in compliance with the License. |
1440 | - You may obtain a copy of the License at |
1441 | - |
1442 | - http://www.apache.org/licenses/LICENSE-2.0 |
1443 | - |
1444 | - Unless required by applicable law or agreed to in writing, software |
1445 | - distributed under the License is distributed on an "AS IS" BASIS, |
1446 | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1447 | - See the License for the specific language governing permissions and |
1448 | - limitations under the License.""" |
1449 | - |
1450 | -import string |
1451 | -import sys |
1452 | - |
1453 | -ctest_failed_file = "@zorbaBuildDir@/Testing/Temporary/LastTestsFailed.log" |
1454 | -ctest_log_file = "@zorbaBuildDir@/Testing/Temporary/LastTest.log" |
1455 | - |
1456 | -out_file = "@zorbaBuildDir@/result.xml" |
1457 | - |
1458 | -out = open ( out_file, 'w' ) |
1459 | - |
1460 | -out.write ( '<?xml version="1.0" encoding="UTF-8"?>\n' ) |
1461 | -out.write ( '<test-suite-result\n' ) |
1462 | -out.write ( " xmlns='http://www.w3.org/2005/02/query-test-XQTSResult'\n" ) |
1463 | -out.write ( ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n' ) |
1464 | -out.write ( ' <implementation\n' ) |
1465 | -out.write ( ' name="Zorba"\n' ) |
1466 | -out.write ( ' version="@zorbaVersion@">\n' ) |
1467 | -out.write ( ' <organization\n' ) |
1468 | -out.write ( ' name="FLWOR Foundation"\n' ) |
1469 | -out.write ( ' website="http://www.zobra-xquery.com />"\n' ) |
1470 | -out.write ( ' <subittor\n' ) |
1471 | -out.write ( ' name="Timh Kraska"\n' ) |
1472 | -out.write ( ' email="tim.kraska@inf.ethz.ch" />\n' ) |
1473 | -out.write ( ' <description>\n' ) |
1474 | -out.write ( ' <p>Zorba is a XQuery processor writtenin C++ available under the Apache License.</p>\n' ) |
1475 | -out.write ( ' </description>\n' ) |
1476 | - |
1477 | - |
1478 | -def has_testing ( s ): |
1479 | - yes = string.find ( s, 'Testing:' ) |
1480 | - yes2 = s.find ( 'w3c_testsuite' ) |
1481 | - return yes > 0 and yes2 > 0 |
1482 | - |
1483 | -def get_test_name ( s ) : |
1484 | - words = string.split ( s, '/' ) |
1485 | - l = len ( words ) |
1486 | - name = words[ l -1] |
1487 | - name = string.strip ( name ) |
1488 | - return name |
1489 | - |
1490 | -try: |
1491 | - failedfile = open ( ctest_failed_file, 'r' ) |
1492 | - failed = True |
1493 | -except IOError : |
1494 | - print "CTest failed log not found" |
1495 | - print "Assuming that CTest was run and that there were no failures" |
1496 | - failed = False |
1497 | - |
1498 | -failures = set() |
1499 | -if failed : |
1500 | - for line in failedfile: |
1501 | - i = string.find ( line, "w3c_testsuite" ) |
1502 | - if i > 0 : |
1503 | - name = get_test_name ( line ) |
1504 | - failures.add ( name ) |
1505 | - |
1506 | -try: |
1507 | - file = open ( ctest_log_file, 'r' ) |
1508 | -except IOError : |
1509 | - print "Ctest log file not found" |
1510 | - print "Run CTest before this script" |
1511 | - sys.exit ( 1 ) |
1512 | - |
1513 | -for line in file: |
1514 | - if has_testing ( line ): |
1515 | - name = get_test_name ( line ) |
1516 | - if name in failures : |
1517 | - out.write ( '<test-case name="%s" result="failed" />\n' % name ) |
1518 | - else : |
1519 | - out.write ( '<test-case name="%s" result="passed" />\n' % name ) |
1520 | - |
1521 | -out.write ( '</test-suite-result>' ) |
1522 | |
1523 | === removed file 'test/rbkt/Scripts/tidy_xmlfrag' |
1524 | --- test/rbkt/Scripts/tidy_xmlfrag 2013-02-07 17:24:36 +0000 |
1525 | +++ test/rbkt/Scripts/tidy_xmlfrag 1970-01-01 00:00:00 +0000 |
1526 | @@ -1,15 +0,0 @@ |
1527 | -# Copyright 2006-2008 The FLWOR Foundation. |
1528 | -# |
1529 | -# Licensed under the Apache License, Version 2.0 (the "License"); |
1530 | -# you may not use this file except in compliance with the License. |
1531 | -# You may obtain a copy of the License at |
1532 | -# |
1533 | -# http://www.apache.org/licenses/LICENSE-2.0 |
1534 | -# |
1535 | -# Unless required by applicable law or agreed to in writing, software |
1536 | -# distributed under the License is distributed on an "AS IS" BASIS, |
1537 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1538 | -# See the License for the specific language governing permissions and |
1539 | -# limitations under the License. |
1540 | -#!/bin/bash |
1541 | -perl -pe 's#<([^> ]+)([^>]*?)/ *>#<$1 $2></$1>#g;s/^<\?xml[^>]*\?>//g' | (echo '<root>'; cat; echo '</root>') | tidy -q -xml -indent 2>/dev/null |
1542 | |
1543 | === removed file 'test/rbkt/Scripts/xqftts.sh' |
1544 | --- test/rbkt/Scripts/xqftts.sh 2013-02-07 17:24:36 +0000 |
1545 | +++ test/rbkt/Scripts/xqftts.sh 1970-01-01 00:00:00 +0000 |
1546 | @@ -1,30 +0,0 @@ |
1547 | -#!/bin/bash |
1548 | - |
1549 | -# This shell script checks out a fresh XQFTTS from W3C and creates a new XQFTTS_current.zip |
1550 | -# W3C provides an ANT script for all their tesuites (XQTS, XQUTS, XQFTTS) |
1551 | - |
1552 | -xqfttsDir=XQFTTS/2007/xpath-full-text-10-test-suite |
1553 | - |
1554 | -export CVSROOT=":pserver:anonymous@dev.w3.org:/sources/public" |
1555 | -cvs login |
1556 | - |
1557 | -#echo: checking out the Full test test suite (XQFTTS) |
1558 | -#cd $xqfttsDir/../ |
1559 | -#cvs get2007/xpath-full-text-10-test-suite xpath-full-text-10-test-suite |
1560 | - |
1561 | -echo get updates (the password is anonymous) |
1562 | -cd $xqfttsDir |
1563 | -cvs update |
1564 | - |
1565 | -echo create new XQFTTS_development.zip archive |
1566 | -echo NOTE: Ant (the build generator for Java) is a requirement for this |
1567 | -cd $xqfttsDir/Tools/ZipXQTS |
1568 | -ant -buildfile Build.xml |
1569 | - |
1570 | -echo copy the new XQFTTS_development.zip archive to /tmp/XQFTTS_current.zip |
1571 | -echo Note: the name of the .ZIP in /tmp folder has to match the name in the import_w3c_full_text_testsuite.sh |
1572 | -echo for the ZIP variable at line 58 |
1573 | -cp $xqfttsDir/PublicPagesStagingArea/XQFTTS_development.zip /tmp/XQFTTS_current.zip |
1574 | - |
1575 | -echo now, if you comment the lines that download the .ZIP from W3C (lines 59 and 60) |
1576 | -echo and run the import_w3c_full_text_testsuite.sh you are all set ! |
1577 | \ No newline at end of file |
1578 | |
1579 | === modified file 'test/sax2/CMakeLists.txt' |
1580 | --- test/sax2/CMakeLists.txt 2013-02-26 04:12:43 +0000 |
1581 | +++ test/sax2/CMakeLists.txt 2013-05-16 09:25:46 +0000 |
1582 | @@ -12,19 +12,6 @@ |
1583 | # See the License for the specific language governing permissions and |
1584 | # limitations under the License. |
1585 | |
1586 | -# configure the testdriver |
1587 | -CONFIGURE_FILE(sax2testdriverconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/sax2testdriverconfig.h) |
1588 | - |
1589 | -# Compile and build the testdriver executable |
1590 | -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) |
1591 | -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/test/commons) |
1592 | - |
1593 | -SET (SAX2_TESTDRIVER_SRCS |
1594 | - sax2testdriver.cpp |
1595 | - ${CMAKE_SOURCE_DIR}/test/commons/testdriver_comparator.cpp |
1596 | - ) |
1597 | - |
1598 | -ZORBA_GENERATE_EXE(sax2testdriver "${SAX2_TESTDRIVER_SRCS}" "" "" "") |
1599 | |
1600 | # Compute results directory for testdriver |
1601 | SET (_results_dir "${CMAKE_CURRENT_BINARY_DIR}/QueryResults") |
1602 | |
1603 | === removed file 'test/sax2/sax2testdriverconfig.h.in' |
1604 | --- test/sax2/sax2testdriverconfig.h.in 2013-02-07 17:24:36 +0000 |
1605 | +++ test/sax2/sax2testdriverconfig.h.in 1970-01-01 00:00:00 +0000 |
1606 | @@ -1,26 +0,0 @@ |
1607 | -/* |
1608 | - * Copyright 2006-2008 The FLWOR Foundation. |
1609 | - * |
1610 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
1611 | - * you may not use this file except in compliance with the License. |
1612 | - * You may obtain a copy of the License at |
1613 | - * |
1614 | - * http://www.apache.org/licenses/LICENSE-2.0 |
1615 | - * |
1616 | - * Unless required by applicable law or agreed to in writing, software |
1617 | - * distributed under the License is distributed on an "AS IS" BASIS, |
1618 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1619 | - * See the License for the specific language governing permissions and |
1620 | - * limitations under the License. |
1621 | - */ |
1622 | - |
1623 | -#ifndef XQP_SAX2_TESTDRIVER_CONFIG_H |
1624 | -#define XQP_SAX2_TESTDRIVER_CONFIG_H |
1625 | - |
1626 | -namespace zorba { |
1627 | - |
1628 | -static std::string SAX2_SRC_DIR = "@CMAKE_CURRENT_SOURCE_DIR@"; |
1629 | -static std::string SAX2_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"; |
1630 | - |
1631 | -} |
1632 | -#endif |
1633 | |
1634 | === removed file 'test/timer.h' |
1635 | --- test/timer.h 2013-02-07 17:24:36 +0000 |
1636 | +++ test/timer.h 1970-01-01 00:00:00 +0000 |
1637 | @@ -1,73 +0,0 @@ |
1638 | -/* |
1639 | - * Copyright 2006-2008 The FLWOR Foundation. |
1640 | - * |
1641 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
1642 | - * you may not use this file except in compliance with the License. |
1643 | - * You may obtain a copy of the License at |
1644 | - * |
1645 | - * http://www.apache.org/licenses/LICENSE-2.0 |
1646 | - * |
1647 | - * Unless required by applicable law or agreed to in writing, software |
1648 | - * distributed under the License is distributed on an "AS IS" BASIS, |
1649 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1650 | - * See the License for the specific language governing permissions and |
1651 | - * limitations under the License. |
1652 | - */ |
1653 | -/** |
1654 | - * Class to measure execution time based on CPU clocks and system time. |
1655 | - * made by Dongseop Kwon (subby@db.snu.ac.kr), 23/07/2003 |
1656 | - */ |
1657 | - |
1658 | - |
1659 | -#ifndef ZORBA_TIMER_H |
1660 | -#define ZORBA_TIMER_H |
1661 | - |
1662 | -#include <ctime> |
1663 | -#ifndef WIN32 |
1664 | -#include <sys/time.h> |
1665 | -#else |
1666 | -#include <time.h> |
1667 | -#endif |
1668 | - |
1669 | -#include <iostream> |
1670 | - |
1671 | - |
1672 | -class Timer |
1673 | -{ |
1674 | - clock_t startClock; |
1675 | - clock_t suspendClock; |
1676 | - clock_t endClock; |
1677 | - |
1678 | -#ifndef WIN32 |
1679 | - double startTime; |
1680 | - double endTime; |
1681 | - double suspendTime; |
1682 | -#endif |
1683 | - |
1684 | - bool suspended; |
1685 | - bool running; |
1686 | - bool verbose; |
1687 | - |
1688 | -public: |
1689 | - // timer routines |
1690 | - void start(); |
1691 | - void end(); |
1692 | - void suspend(); |
1693 | - void resume(); |
1694 | - |
1695 | - double getClock(); |
1696 | - double getTime(); |
1697 | - |
1698 | - // print all information |
1699 | - std::ostream& print(std::ostream& os); |
1700 | - bool isRunning(); |
1701 | - |
1702 | - Timer(bool start = true, bool verbose = false); |
1703 | -}; |
1704 | -#endif |
1705 | - |
1706 | -/* |
1707 | - * Local variables: |
1708 | - * mode: c++ |
1709 | - * End: |
1710 | - */ |
1711 | |
1712 | === modified file 'test/unit/CMakeLists.txt' |
1713 | --- test/unit/CMakeLists.txt 2013-05-14 09:59:59 +0000 |
1714 | +++ test/unit/CMakeLists.txt 2013-05-16 09:25:46 +0000 |
1715 | @@ -119,6 +119,7 @@ |
1716 | ) |
1717 | |
1718 | # add the executable |
1719 | +INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/test/driver") |
1720 | ZORBA_GENERATE_EXE(UnitTests "${UnitTests}" "" "" "") |
1721 | |
1722 | # remove the test driver source file |
1723 | |
1724 | === modified file 'test/unit/cxx_api_changes.cpp' |
1725 | --- test/unit/cxx_api_changes.cpp 2013-02-07 17:24:36 +0000 |
1726 | +++ test/unit/cxx_api_changes.cpp 2013-05-16 09:25:46 +0000 |
1727 | @@ -29,7 +29,7 @@ |
1728 | #include <zorba/xquery_exception.h> |
1729 | |
1730 | |
1731 | -#include "rbkt/testdriverconfig.h" |
1732 | +#include <testdriverconfig.h> |
1733 | |
1734 | using namespace zorba; |
1735 | |
1736 | |
1737 | === modified file 'test/update/CMakeLists.txt' |
1738 | --- test/update/CMakeLists.txt 2013-02-26 04:12:43 +0000 |
1739 | +++ test/update/CMakeLists.txt 2013-05-16 09:25:46 +0000 |
1740 | @@ -12,22 +12,6 @@ |
1741 | # See the License for the specific language governing permissions and |
1742 | # limitations under the License. |
1743 | |
1744 | -# configure the testdriver |
1745 | -CONFIGURE_FILE(testdriverconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/testdriverconfig.h) |
1746 | - |
1747 | -# Compile and build the testdriver executable |
1748 | -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) |
1749 | -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/test/commons) |
1750 | - |
1751 | -SET(UPDTESTDRIVER_SRCS |
1752 | - updtestdriver.cpp |
1753 | - ${CMAKE_SOURCE_DIR}/test/commons/testdriver_comparator.cpp |
1754 | - ${CMAKE_SOURCE_DIR}/test/commons/testuriresolver.cpp) |
1755 | - |
1756 | -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) |
1757 | - |
1758 | -INCLUDE(${CMAKE_SOURCE_DIR}/cmake_modules/ZorbaGenerateExe.cmake) |
1759 | -ZORBA_GENERATE_EXE("updtestdriver" "${UPDTESTDRIVER_SRCS}" "" "" "") |
1760 | |
1761 | # collect all spec files (suffix .spec) in all subdirectories of the Queries dir |
1762 | FILE(GLOB_RECURSE TESTFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/Queries/ FOLLOW_SYMLINKS "*.spec") |
1763 | |
1764 | === removed file 'test/update/testdriverconfig.h.in' |
1765 | --- test/update/testdriverconfig.h.in 2013-02-07 17:24:36 +0000 |
1766 | +++ test/update/testdriverconfig.h.in 1970-01-01 00:00:00 +0000 |
1767 | @@ -1,27 +0,0 @@ |
1768 | -/* |
1769 | - * Copyright 2006-2008 The FLWOR Foundation. |
1770 | - * |
1771 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
1772 | - * you may not use this file except in compliance with the License. |
1773 | - * You may obtain a copy of the License at |
1774 | - * |
1775 | - * http://www.apache.org/licenses/LICENSE-2.0 |
1776 | - * |
1777 | - * Unless required by applicable law or agreed to in writing, software |
1778 | - * distributed under the License is distributed on an "AS IS" BASIS, |
1779 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1780 | - * See the License for the specific language governing permissions and |
1781 | - * limitations under the License. |
1782 | - */ |
1783 | -#ifndef XQP_UPDATE_TESTDRIVER_CONFIG_H |
1784 | -#define XQP_UPDATE_TESTDRIVER_CONFIG_H |
1785 | - |
1786 | -namespace zorba { |
1787 | - |
1788 | -#cmakedefine ZORBA_TEST_PLAN_SERIALIZATION |
1789 | - |
1790 | -static std::string UPDATE_SRC_DIR = "@CMAKE_CURRENT_SOURCE_DIR@"; |
1791 | -static std::string UPDATE_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"; |
1792 | - |
1793 | -} |
1794 | -#endif |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ prune-rbkt- 2013-05- 16T08-31- 55.534Z/ log.html
Log at: http://