simple-xspec-wrapper 0.1.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +11 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +6 -0
  8. data/Gemfile.lock +37 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +49 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/exe/xspec +16 -0
  15. data/lib/xspec/version.rb +3 -0
  16. data/lib/xspec.rb +256 -0
  17. data/simple-xspec-wrapper.gemspec +28 -0
  18. data/spec-test.xml +1125 -0
  19. data/vendor/xspec-1.0.0/.gitignore +7 -0
  20. data/vendor/xspec-1.0.0/.travis.yml +57 -0
  21. data/vendor/xspec-1.0.0/LICENSE +21 -0
  22. data/vendor/xspec-1.0.0/README.md +26 -0
  23. data/vendor/xspec-1.0.0/appveyor.yml +77 -0
  24. data/vendor/xspec-1.0.0/bin/xspec.bat +620 -0
  25. data/vendor/xspec-1.0.0/bin/xspec.sh +403 -0
  26. data/vendor/xspec-1.0.0/build.xml +369 -0
  27. data/vendor/xspec-1.0.0/editors/emacs/README +31 -0
  28. data/vendor/xspec-1.0.0/editors/emacs/schemas.xml +6 -0
  29. data/vendor/xspec-1.0.0/editors/oxygen/.cvsignore +2 -0
  30. data/vendor/xspec-1.0.0/editors/oxygen/README +11 -0
  31. data/vendor/xspec-1.0.0/editors/oxygen/build.xml +38 -0
  32. data/vendor/xspec-1.0.0/editors/oxygen/templates/xspec.xml +17 -0
  33. data/vendor/xspec-1.0.0/editors/oxygen/xspec.framework +175 -0
  34. data/vendor/xspec-1.0.0/find-examples.xml +37 -0
  35. data/vendor/xspec-1.0.0/find-examples.xsl +615 -0
  36. data/vendor/xspec-1.0.0/graphics/3angle-down.gif +0 -0
  37. data/vendor/xspec-1.0.0/graphics/3angle-right.gif +0 -0
  38. data/vendor/xspec-1.0.0/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.class +0 -0
  39. data/vendor/xspec-1.0.0/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.java +209 -0
  40. data/vendor/xspec-1.0.0/src/ant/find-test-failure.xsl +17 -0
  41. data/vendor/xspec-1.0.0/src/ant/get-schematron-phase.xsl +17 -0
  42. data/vendor/xspec-1.0.0/src/ant/locate-schematron.xsl +28 -0
  43. data/vendor/xspec-1.0.0/src/ant/make-path.js +4 -0
  44. data/vendor/xspec-1.0.0/src/compiler/generate-common-tests.xsl +604 -0
  45. data/vendor/xspec-1.0.0/src/compiler/generate-query-helper.xsl +152 -0
  46. data/vendor/xspec-1.0.0/src/compiler/generate-query-tests.xsl +473 -0
  47. data/vendor/xspec-1.0.0/src/compiler/generate-query-utils.xql +263 -0
  48. data/vendor/xspec-1.0.0/src/compiler/generate-tests-helper.xsl +169 -0
  49. data/vendor/xspec-1.0.0/src/compiler/generate-tests-utils.xsl +479 -0
  50. data/vendor/xspec-1.0.0/src/compiler/generate-xspec-tests.xsl +503 -0
  51. data/vendor/xspec-1.0.0/src/harnesses/basex/basex-standalone-xquery-harness.xproc +135 -0
  52. data/vendor/xspec-1.0.0/src/harnesses/basex/basex-xquery-harness.xproc +133 -0
  53. data/vendor/xspec-1.0.0/src/harnesses/exist/exist-xquery-harness.xproc +161 -0
  54. data/vendor/xspec-1.0.0/src/harnesses/harness-lib.xpl +327 -0
  55. data/vendor/xspec-1.0.0/src/harnesses/marklogic/ml-xquery-harness.xproc +143 -0
  56. data/vendor/xspec-1.0.0/src/harnesses/saxon/saxon-xquery-harness.xproc +108 -0
  57. data/vendor/xspec-1.0.0/src/harnesses/saxon/saxon-xslt-harness.xproc +85 -0
  58. data/vendor/xspec-1.0.0/src/harnesses/zorba/zorba-xquery-harness.xproc +134 -0
  59. data/vendor/xspec-1.0.0/src/reporter/coverage-report.xsl +378 -0
  60. data/vendor/xspec-1.0.0/src/reporter/format-utils.xsl +220 -0
  61. data/vendor/xspec-1.0.0/src/reporter/format-xspec-report-folding.xsl +164 -0
  62. data/vendor/xspec-1.0.0/src/reporter/format-xspec-report.xsl +410 -0
  63. data/vendor/xspec-1.0.0/src/reporter/junit-report.xsl +93 -0
  64. data/vendor/xspec-1.0.0/src/reporter/test-report.css +469 -0
  65. data/vendor/xspec-1.0.0/src/schemas/find-examples.rnc +90 -0
  66. data/vendor/xspec-1.0.0/src/schemas/xspec.rnc +304 -0
  67. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_abstract_expand.xsl +313 -0
  68. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_dsdl_include.xsl +1519 -0
  69. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_message.xsl +64 -0
  70. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_message_xslt2.xsl +64 -0
  71. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_skeleton_for_saxon.xsl +2306 -0
  72. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_skeleton_for_xslt1.xsl +1851 -0
  73. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_svrl_for_xslt1.xsl +614 -0
  74. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_svrl_for_xslt2.xsl +692 -0
  75. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/readme.txt +101 -0
  76. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-cs.xhtml +56 -0
  77. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-de.xhtml +55 -0
  78. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-en.xhtml +57 -0
  79. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-fr.xhtml +54 -0
  80. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-ja.xhtml +53 -0
  81. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-nl.xhtml +58 -0
  82. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/schematron-skeleton-api.htm +723 -0
  83. data/vendor/xspec-1.0.0/src/schematron/sch-location-compare.xsl +139 -0
  84. data/vendor/xspec-1.0.0/src/schematron/schut-to-xspec.xsl +179 -0
  85. data/vendor/xspec-1.0.0/test/Makefile +117 -0
  86. data/vendor/xspec-1.0.0/test/README +5 -0
  87. data/vendor/xspec-1.0.0/test/catalog/xspec-160_catalog.xml +4 -0
  88. data/vendor/xspec-1.0.0/test/catalog/xspec-160_schematron.xspec +6 -0
  89. data/vendor/xspec-1.0.0/test/catalog/xspec-160_xslt.xspec +5 -0
  90. data/vendor/xspec-1.0.0/test/end-to-end/README.md +42 -0
  91. data/vendor/xspec-1.0.0/test/end-to-end/cases/.gitignore +1 -0
  92. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/.gitignore +3 -0
  93. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-50-result-norm.html +74 -0
  94. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-55-result-norm.html +112 -0
  95. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-focus-1-result-norm.html +109 -0
  96. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-function-result-norm.html +118 -0
  97. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-import-result-norm.html +163 -0
  98. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-imported-result-norm.html +95 -0
  99. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-pending-result-norm.html +123 -0
  100. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-rule-result-norm.html +109 -0
  101. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-three-dots-result-norm.html +1237 -0
  102. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-50.xsl +7 -0
  103. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-50.xspec +10 -0
  104. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-55.xsl +2 -0
  105. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-55.xspec +18 -0
  106. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-focus-1.xspec +71 -0
  107. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-function.xspec +50 -0
  108. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-import.xspec +50 -0
  109. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-imported.xspec +48 -0
  110. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-pending.xspec +89 -0
  111. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-rule.xspec +76 -0
  112. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-three-dots.xsl +49 -0
  113. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-three-dots.xspec +527 -0
  114. data/vendor/xspec-1.0.0/test/end-to-end/generate-expected.cmd +51 -0
  115. data/vendor/xspec-1.0.0/test/end-to-end/generate-expected.sh +25 -0
  116. data/vendor/xspec-1.0.0/test/end-to-end/processor/_deserializer.xsl +53 -0
  117. data/vendor/xspec-1.0.0/test/end-to-end/processor/_normalizer.xsl +192 -0
  118. data/vendor/xspec-1.0.0/test/end-to-end/processor/_serializer.xsl +15 -0
  119. data/vendor/xspec-1.0.0/test/end-to-end/processor/_util.xsl +35 -0
  120. data/vendor/xspec-1.0.0/test/end-to-end/processor/compare.xsl +88 -0
  121. data/vendor/xspec-1.0.0/test/end-to-end/processor/normalize.xsl +28 -0
  122. data/vendor/xspec-1.0.0/test/end-to-end/run-e2e-tests.cmd +61 -0
  123. data/vendor/xspec-1.0.0/test/end-to-end/run-e2e-tests.sh +28 -0
  124. data/vendor/xspec-1.0.0/test/generate-tests-utils.xspec +636 -0
  125. data/vendor/xspec-1.0.0/test/generate-x-utils.xspec +173 -0
  126. data/vendor/xspec-1.0.0/test/generate-xspec-tests.xspec +64 -0
  127. data/vendor/xspec-1.0.0/test/run-xspec-tests.cmd +83 -0
  128. data/vendor/xspec-1.0.0/test/run-xspec-tests.sh +42 -0
  129. data/vendor/xspec-1.0.0/test/sch-location-compare.xspec +179 -0
  130. data/vendor/xspec-1.0.0/test/schematron/data/standards.xml +7 -0
  131. data/vendor/xspec-1.0.0/test/schematron/schematron-017.sch +9 -0
  132. data/vendor/xspec-1.0.0/test/schematron/schematron-018.sch +17 -0
  133. data/vendor/xspec-1.0.0/test/schematron/schematron-019.sch +13 -0
  134. data/vendor/xspec-1.0.0/test/schematron/schematron-020-01.sch +35 -0
  135. data/vendor/xspec-1.0.0/test/schematron/schematron-020.sch +32 -0
  136. data/vendor/xspec-1.0.0/test/schematron/schematron-021.sch +28 -0
  137. data/vendor/xspec-1.0.0/test/schematron/schematron-022.sch +18 -0
  138. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-compile.xsl +8 -0
  139. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-expand.xsl +8 -0
  140. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-include.xsl +8 -0
  141. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-001-in.xspec +5 -0
  142. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-001-out.xspec +7 -0
  143. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002-in.xspec +5 -0
  144. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002-out.xspec +7 -0
  145. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002.sch +4 -0
  146. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-003-in.xspec +7 -0
  147. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-003-out.xspec +9 -0
  148. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-004-in.xspec +20 -0
  149. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-004-out.xspec +22 -0
  150. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-005-in.xspec +6 -0
  151. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-005-out.xspec +8 -0
  152. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-006-in.xspec +11 -0
  153. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-006-out.xspec +13 -0
  154. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007-in.xspec +7 -0
  155. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007-out.xspec +9 -0
  156. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007.xml +2 -0
  157. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-008-in.xspec +9 -0
  158. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-008-out.xspec +9 -0
  159. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-import-in.xspec +5 -0
  160. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-in.xspec +6 -0
  161. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-out.xspec +10 -0
  162. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-import.xspec +5 -0
  163. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-in.xspec +6 -0
  164. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-out.xspec +8 -0
  165. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-011-in.xspec +6 -0
  166. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-011-out.xspec +8 -0
  167. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-01.xml +4 -0
  168. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-02.xml +13 -0
  169. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-out.xspec +81 -0
  170. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-013-in.xspec +6 -0
  171. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-013-out.xspec +8 -0
  172. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-test.sch +4 -0
  173. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-test.sch.xsl +4 -0
  174. data/vendor/xspec-1.0.0/test/schematron-01.sch +17 -0
  175. data/vendor/xspec-1.0.0/test/schematron-01.xml +14 -0
  176. data/vendor/xspec-1.0.0/test/schematron-01.xspec +14 -0
  177. data/vendor/xspec-1.0.0/test/schematron-012.xspec +83 -0
  178. data/vendor/xspec-1.0.0/test/schematron-014-01.xml +10 -0
  179. data/vendor/xspec-1.0.0/test/schematron-014.sch +16 -0
  180. data/vendor/xspec-1.0.0/test/schematron-014.xspec +11 -0
  181. data/vendor/xspec-1.0.0/test/schematron-015.sch +16 -0
  182. data/vendor/xspec-1.0.0/test/schematron-015.xspec +11 -0
  183. data/vendor/xspec-1.0.0/test/schematron-016.sch +19 -0
  184. data/vendor/xspec-1.0.0/test/schematron-016.xspec +171 -0
  185. data/vendor/xspec-1.0.0/test/schematron-017.xspec +26 -0
  186. data/vendor/xspec-1.0.0/test/schematron-018.xspec +120 -0
  187. data/vendor/xspec-1.0.0/test/schematron-019.xspec +16 -0
  188. data/vendor/xspec-1.0.0/test/schematron-020.xspec +53 -0
  189. data/vendor/xspec-1.0.0/test/schematron-021.xspec +27 -0
  190. data/vendor/xspec-1.0.0/test/schematron-022.xspec +15 -0
  191. data/vendor/xspec-1.0.0/test/schematron-param-001.xspec +50 -0
  192. data/vendor/xspec-1.0.0/test/schut-to-xspec-012.sch +27 -0
  193. data/vendor/xspec-1.0.0/test/schut-to-xspec.xspec +85 -0
  194. data/vendor/xspec-1.0.0/test/unit-expect-xsl.xspec +28 -0
  195. data/vendor/xspec-1.0.0/test/xspec-26.xsl +19 -0
  196. data/vendor/xspec-1.0.0/test/xspec-26.xspec +17 -0
  197. data/vendor/xspec-1.0.0/test/xspec-30.xml +2 -0
  198. data/vendor/xspec-1.0.0/test/xspec-30.xsl +6 -0
  199. data/vendor/xspec-1.0.0/test/xspec-30.xspec +8 -0
  200. data/vendor/xspec-1.0.0/test/xspec-33.xsl +7 -0
  201. data/vendor/xspec-1.0.0/test/xspec-33.xspec +15 -0
  202. data/vendor/xspec-1.0.0/test/xspec-46.xsl +7 -0
  203. data/vendor/xspec-1.0.0/test/xspec-46.xspec +9 -0
  204. data/vendor/xspec-1.0.0/test/xspec-72.xsl +13 -0
  205. data/vendor/xspec-1.0.0/test/xspec-72.xspec +19 -0
  206. data/vendor/xspec-1.0.0/test/xspec-bat.cmd +757 -0
  207. data/vendor/xspec-1.0.0/test/xspec-focus-2.xspec +91 -0
  208. data/vendor/xspec-1.0.0/test/xspec-junit.xspec +78 -0
  209. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xml +1003 -0
  210. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xslt +10 -0
  211. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xspec +13 -0
  212. data/vendor/xspec-1.0.0/test/xspec-tested.xql +44 -0
  213. data/vendor/xspec-1.0.0/test/xspec-tested.xsl +64 -0
  214. data/vendor/xspec-1.0.0/test/xspec-variable.xml +3 -0
  215. data/vendor/xspec-1.0.0/test/xspec-variable.xspec +58 -0
  216. data/vendor/xspec-1.0.0/test/xspec-xslt3.xsl +13 -0
  217. data/vendor/xspec-1.0.0/test/xspec-xslt3.xspec +12 -0
  218. data/vendor/xspec-1.0.0/test/xspec.bats +420 -0
  219. data/vendor/xspec-1.0.0/tutorial/escape-for-regex.xslt +40 -0
  220. data/vendor/xspec-1.0.0/tutorial/escape-for-regex.xspec +75 -0
  221. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.sch +17 -0
  222. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.xml +11 -0
  223. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.xspec +14 -0
  224. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-PhaseA.xspec +11 -0
  225. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-PhaseB.xspec +12 -0
  226. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import1.xspec +10 -0
  227. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import2.xspec +8 -0
  228. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import3.xspec +10 -0
  229. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02.sch +58 -0
  230. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02.xml +19 -0
  231. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03-doc1.xml +6 -0
  232. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03-doc2.xml +7 -0
  233. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03.sch +29 -0
  234. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03.xspec +63 -0
  235. data/vendor/xspec-1.0.0/tutorial/schematron/demo-04.sch +20 -0
  236. data/vendor/xspec-1.0.0/tutorial/schematron/demo-04.xspec +33 -0
  237. data/vendor/xspec-1.0.0/tutorial/schematron/quickfix.sch +81 -0
  238. data/vendor/xspec-1.0.0/tutorial/xquery-tutorial.xq +8 -0
  239. data/vendor/xspec-1.0.0/tutorial/xquery-tutorial.xspec +16 -0
  240. data/vendor/xspec-1.0.0/xproject/project.xml +8 -0
  241. data/vendor/xspec-1.0.0/xproject/release-project.xsl +41 -0
  242. metadata +341 -0
@@ -0,0 +1,620 @@
1
+ @echo off
2
+
3
+ rem
4
+ rem ##############################################################################
5
+ rem ##
6
+ rem ## This script is used to compile a test suite to XSLT, run it, format
7
+ rem ## the report and open it in a browser.
8
+ rem ##
9
+ rem ## It relies on the environment variable SAXON_HOME to be set to the
10
+ rem ## dir Saxon has been installed to (i.e. the containing the Saxon JAR
11
+ rem ## file), or on SAXON_CP to be set to a full classpath containing
12
+ rem ## Saxon (and maybe more). The latter has precedence over the former.
13
+ rem ##
14
+ rem ## It also uses the environment variable XSPEC_HOME. It must be set
15
+ rem ## to the XSpec install directory. By default, it uses this script's
16
+ rem ## parent dir.
17
+ rem ##
18
+ rem ## TODO: Not aware of the EXPath Packaging System
19
+ rem ##
20
+ rem ##############################################################################
21
+ rem
22
+ rem Comments (rem)
23
+ rem Comments starting with '#' are derived from xspec.sh (possibly with
24
+ rem some modifications).
25
+ rem
26
+ rem Environment variables (%FOO%)
27
+ rem Environment variables are tried to be on parity with xspec.sh,
28
+ rem except that those starting with 'WIN_' are only for this batch
29
+ rem file.
30
+ rem
31
+ rem Labels (:foo)
32
+ rem Labels are tried to be on parity with functions in xspec.sh, except
33
+ rem that those starting with 'win_' are only for this batch file.
34
+ rem
35
+
36
+ rem
37
+ rem Skip over "utility functions"
38
+ rem
39
+ goto :win_main_enter
40
+
41
+ rem ##
42
+ rem ## utility functions #########################################################
43
+ rem ##
44
+
45
+ :usage
46
+ if not "%~1"=="" (
47
+ call :win_echo %1
48
+ echo:
49
+ )
50
+ echo Usage: xspec [-t^|-q^|-s^|-c^|-j^|-h] filename [coverage]
51
+ echo:
52
+ echo filename the XSpec document
53
+ echo -t test an XSLT stylesheet (the default)
54
+ echo -q test an XQuery module (mutually exclusive with -t and -s)
55
+ echo -s test a Schematron schema (mutually exclusive with -t and -q)
56
+ echo -c output test coverage report
57
+ echo -j output JUnit report
58
+ echo -h display this help message
59
+ echo coverage deprecated, use -c instead
60
+ goto :EOF
61
+
62
+ :die
63
+ echo:
64
+ echo *** %~1 >&2
65
+ rem
66
+ rem Now, to exit the batch file, you must go to :win_main_error_exit from
67
+ rem the main code flow.
68
+ rem
69
+ goto :EOF
70
+
71
+ :xslt
72
+ java -cp "%CP%" net.sf.saxon.Transform %*
73
+ goto :EOF
74
+
75
+ :win_xslt_trace
76
+ rem
77
+ rem Inner Redirect:
78
+ rem By swapping stdout and stderr, send stderr to pipe (as stdout)
79
+ rem while allowing original stdout to survive (as stderr)
80
+ rem
81
+ rem Pipe:
82
+ rem To keep the output XML well-formed, remove the stdout lines
83
+ rem that don't look like XML element, assuming %COVERAGE_CLASS%
84
+ rem emits every required line in this format
85
+ rem
86
+ rem Outer Redirect:
87
+ rem To restore the original direction, swap stdout and stderr again
88
+ rem
89
+ ( java -cp "%CP%" net.sf.saxon.Transform %* 3>&2 2>&1 1>&3 | findstr /r /c:"^<..*>$" ) 3>&2 2>&1 1>&3
90
+ goto :EOF
91
+
92
+ :xquery
93
+ java -cp "%CP%" net.sf.saxon.Query %*
94
+ goto :EOF
95
+
96
+ :win_xquery_trace
97
+ rem
98
+ rem As for redirect and pipe, see :win_xslt_trace
99
+ rem
100
+ ( java -cp "%CP%" net.sf.saxon.Query %* 3>&2 2>&1 1>&3 | findstr /r /c:"^<..*>$" ) 3>&2 2>&1 1>&3
101
+ goto :EOF
102
+
103
+ :win_reset_options
104
+ set XSLT=
105
+ set XQUERY=
106
+ set SCHEMATRON=
107
+ set SCH_PARAMS=
108
+ set COVERAGE=
109
+ set JUNIT=
110
+ set WIN_HELP=
111
+ set WIN_UNKNOWN_OPTION=
112
+ set WIN_DEPRECATED_COVERAGE=
113
+ set WIN_EXTRA_OPTION=
114
+ set XSPEC=
115
+ goto :EOF
116
+
117
+ :win_get_options
118
+ set WIN_ARGV=%~1
119
+
120
+ if not defined WIN_ARGV (
121
+ goto :EOF
122
+ ) else if "%WIN_ARGV%"=="-t" (
123
+ set XSLT=1
124
+ ) else if "%WIN_ARGV%"=="-q" (
125
+ set XQUERY=1
126
+ ) else if "%WIN_ARGV%"=="-s" (
127
+ set SCHEMATRON=1
128
+ ) else if "%WIN_ARGV%"=="-c" (
129
+ set COVERAGE=1
130
+ ) else if "%WIN_ARGV%"=="-j" (
131
+ set JUNIT=1
132
+ ) else if "%WIN_ARGV%"=="-h" (
133
+ set WIN_HELP=1
134
+ ) else if "%WIN_ARGV:~0,1%"=="-" (
135
+ set "WIN_UNKNOWN_OPTION=%WIN_ARGV%"
136
+ ) else if defined XSPEC (
137
+ if "%WIN_ARGV%"=="coverage" (
138
+ set WIN_DEPRECATED_COVERAGE=1
139
+ ) else (
140
+ set "WIN_EXTRA_OPTION=%WIN_ARGV%"
141
+ goto :EOF
142
+ )
143
+ ) else (
144
+ set "XSPEC=%WIN_ARGV%"
145
+ )
146
+
147
+ shift
148
+
149
+ rem
150
+ rem %* doesn't reflect shift. Pass %n individually.
151
+ rem
152
+ call :win_get_options %1 %2 %3 %4 %5 %6 %7 %8 %9
153
+ goto :EOF
154
+
155
+
156
+ :schematron_compile
157
+ echo Setting up Schematron...
158
+
159
+ if not defined SCHEMATRON_XSLT_INCLUDE set SCHEMATRON_XSLT_INCLUDE="%XSPEC_HOME%\src\schematron\iso-schematron\iso_dsdl_include.xsl"
160
+ if not defined SCHEMATRON_XSLT_EXPAND set SCHEMATRON_XSLT_EXPAND="%XSPEC_HOME%\src\schematron\iso-schematron\iso_abstract_expand.xsl"
161
+ if not defined SCHEMATRON_XSLT_COMPILE set SCHEMATRON_XSLT_COMPILE="%XSPEC_HOME%\src\schematron\iso-schematron\iso_svrl_for_xslt2.xsl"
162
+
163
+ rem # get URI to Schematron file and phase/parameters from the XSpec file
164
+ call :xquery -qs:"declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization'; declare option output:method 'text'; replace(iri-to-uri(concat(replace(document-uri(/), '(.*)/.*$', '$1'), '/', /*[local-name() = 'description']/@schematron)), concat(codepoints-to-string(94), 'file:/'), '')" ^
165
+ -s:"%XSPEC%" >"%TEST_DIR%\%TARGET_FILE_NAME%-var.txt" ^
166
+ || ( call :die "Error getting Schematron location" & goto :win_main_error_exit )
167
+ set /P SCH=<"%TEST_DIR%\%TARGET_FILE_NAME%-var.txt"
168
+
169
+ call :xquery -qs:"declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization'; declare option output:method 'text'; declare function local:escape($v) { let $w := if (matches($v,codepoints-to-string((91,92,115,34,93)))) then codepoints-to-string(34) else '' return concat($w, replace($v,codepoints-to-string(34),codepoints-to-string((34,34))), $w)}; string-join(for $p in /*/*[local-name() = 'param'] return if ($p/@select) then concat('?',$p/@name,'=',local:escape($p/@select)) else concat($p/@name,'=',local:escape($p/string())),' ')" ^
170
+ -s:"%XSPEC%" >"%TEST_DIR%\%TARGET_FILE_NAME%-var.txt" ^
171
+ || ( call :die "Error getting Schematron phase and parameters" & goto :win_main_error_exit )
172
+ set /P SCH_PARAMS=<"%TEST_DIR%\%TARGET_FILE_NAME%-var.txt"
173
+ echo Paramaters: %SCH_PARAMS%
174
+ set SCHUT=%XSPEC%-compiled.xspec
175
+ set SCH_COMPILED=%SCH%-compiled.xsl
176
+
177
+ echo:
178
+ echo Compiling the Schematron...
179
+ call :xslt -o:"%TEST_DIR%\%TARGET_FILE_NAME%-sch-temp1.xml" -s:"%SCH%" ^
180
+ -xsl:"%SCHEMATRON_XSLT_INCLUDE%" -versionmsg:off ^
181
+ || ( call :die "Error compiling the Schematron on step 1" & goto :win_main_error_exit )
182
+ call :xslt -o:"%TEST_DIR%\%TARGET_FILE_NAME%-sch-temp2.xml" -s:"%TEST_DIR%\%TARGET_FILE_NAME%-sch-temp1.xml" ^
183
+ -xsl:"%SCHEMATRON_XSLT_EXPAND%" -versionmsg:off ^
184
+ || ( call :die "Error compiling the Schematron on step 2" & goto :win_main_error_exit )
185
+ call :xslt -o:"%SCH_COMPILED%" -s:"%TEST_DIR%\%TARGET_FILE_NAME%-sch-temp2.xml" ^
186
+ -xsl:"%SCHEMATRON_XSLT_COMPILE%" -versionmsg:off ^
187
+ %SCH_PARAMS% ^
188
+ || ( call :die "Error compiling the Schematron on step 3" & goto :win_main_error_exit )
189
+
190
+ rem use XQuery to get full URI to compiled Schematron
191
+ rem echo SCH_COMPILED %SCH_COMPILED%
192
+ rem call :xquery -qs:"declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization'; declare option output:method 'text'; replace(iri-to-uri(document-uri(/)), concat(codepoints-to-string(94), 'file:/'), '')" ^
193
+ rem -s:"%SCH_COMPILED%" >"%TEST_DIR%\%TARGET_FILE_NAME%-var.txt" ^
194
+ rem || ( call :die "Error getting compiled Schematron location" & goto :win_main_error_exit )
195
+ rem set /P SCH_COMPILED=<"%TEST_DIR%\%TARGET_FILE_NAME%-var.txt"
196
+ rem echo SCH_COMPILED %SCH_COMPILED%
197
+
198
+ echo:
199
+ echo Compiling the Schematron tests...
200
+ set TEST_DIR_URI=file:///%TEST_DIR:\=/%
201
+ call :xslt -o:"%SCHUT%" -s:"%XSPEC%" ^
202
+ -xsl:"%XSPEC_HOME%\src\schematron\schut-to-xspec.xsl" ^
203
+ stylesheet="%SCH_COMPILED%" ^
204
+ test_dir="%TEST_DIR_URI%" ^
205
+ || ( call :die "Error compiling the Schematron tests" & goto :win_main_error_exit )
206
+ set XSPEC=%SCHUT%
207
+ echo:
208
+ goto :EOF
209
+
210
+ :cleanup
211
+ if defined SCHEMATRON (
212
+ del /q "%SCHUT%" 2>nul
213
+ del /q "%TEST_DIR%\context-*.xml" 2>nul
214
+ del /q "%TEST_DIR%\%TARGET_FILE_NAME%-var.txt" 2>nul
215
+ del /q "%TEST_DIR%\%TARGET_FILE_NAME%-sch-temp1.xml" 2>nul
216
+ del /q "%TEST_DIR%\%TARGET_FILE_NAME%-sch-temp2.xml" 2>nul
217
+ del /q "%SCH_COMPILED:/=\%" 2>nul
218
+ )
219
+ goto :EOF
220
+
221
+ :win_echo
222
+ rem
223
+ rem Prints a message removing its surrounding quotes (")
224
+ rem
225
+ echo %~1
226
+ goto :EOF
227
+
228
+ rem
229
+ rem Main #########################################################################
230
+ rem
231
+ :win_main_enter
232
+
233
+ rem
234
+ rem Begin localization of environment changes.
235
+ rem Also make sure the command processor extensions are enabled.
236
+ rem
237
+ verify other 2> NUL
238
+ setlocal enableextensions
239
+ if errorlevel 1 (
240
+ echo Unable to enable extensions
241
+ exit /b %ERRORLEVEL%
242
+ )
243
+
244
+ rem
245
+ rem To be compatible with xspec.sh, do not omit this message. It makes the
246
+ rem test automation easier.
247
+ rem
248
+ echo Saxon script not found, invoking JVM directly instead.
249
+ echo:
250
+
251
+ rem
252
+ rem ##
253
+ rem ## some variables ############################################################
254
+ rem ##
255
+ rem
256
+
257
+ rem
258
+ rem # the command to use to open the final HTML report
259
+ rem
260
+ rem Include the command line options (and consequently the double quotes)
261
+ rem if necessary.
262
+ rem
263
+ set OPEN=start "XSpec Report"
264
+
265
+ rem
266
+ rem # set XSPEC_HOME if it has not been set by the user (set it to the
267
+ rem # parent dir of this script)
268
+ rem
269
+ if not defined XSPEC_HOME set XSPEC_HOME=%~dp0..
270
+
271
+ rem
272
+ rem # safety checks
273
+ rem
274
+ for %%I in ("%XSPEC_HOME%") do echo "%%~aI" | find "d" > NUL
275
+ if errorlevel 1 (
276
+ call :win_echo "ERROR: XSPEC_HOME is not a directory: %XSPEC_HOME%"
277
+ exit /b 1
278
+ )
279
+ if not exist "%XSPEC_HOME%\src\compiler\generate-common-tests.xsl" (
280
+ call :win_echo "ERROR: XSPEC_HOME seems to be corrupted: %XSPEC_HOME%"
281
+ exit /b 1
282
+ )
283
+
284
+ rem
285
+ rem # set SAXON_CP (either it has been by the user, or set it from SAXON_HOME)
286
+ rem
287
+
288
+ rem
289
+ rem # Set this variable in your environment or here, if you don't set SAXON_CP
290
+ rem # set SAXON_HOME=C:\path\to\saxon\dir
291
+ rem
292
+ rem Since we don't use the delayed environment variable expansion,
293
+ rem SAXON_HOME must be set outside 'if' scope.
294
+ rem
295
+
296
+ if not defined SAXON_CP (
297
+ if not defined SAXON_HOME (
298
+ echo SAXON_CP and SAXON_HOME both not set!
299
+ )
300
+ if exist "%SAXON_HOME%\saxon9ee.jar" (
301
+ set "SAXON_CP=%SAXON_HOME%\saxon9ee.jar"
302
+ ) else if exist "%SAXON_HOME%\saxon9pe.jar" (
303
+ set "SAXON_CP=%SAXON_HOME%\saxon9pe.jar"
304
+ ) else if exist "%SAXON_HOME%\saxon9he.jar" (
305
+ set "SAXON_CP=%SAXON_HOME%\saxon9he.jar"
306
+ ) else if exist "%SAXON_HOME%\saxon9sa.jar" (
307
+ set "SAXON_CP=%SAXON_HOME%\saxon9sa.jar"
308
+ ) else if exist "%SAXON_HOME%\saxon9.jar" (
309
+ set "SAXON_CP=%SAXON_HOME%\saxon9.jar"
310
+ ) else if exist "%SAXON_HOME%\saxonb9-1-0-8.jar" (
311
+ set "SAXON_CP=%SAXON_HOME%\saxonb9-1-0-8.jar"
312
+ ) else if exist "%SAXON_HOME%\saxon8sa.jar" (
313
+ set "SAXON_CP=%SAXON_HOME%\saxon8sa.jar"
314
+ ) else if exist "%SAXON_HOME%\saxon8.jar" (
315
+ set "SAXON_CP=%SAXON_HOME%\saxon8.jar"
316
+ ) else (
317
+ call :win_echo "Saxon jar cannot be found in SAXON_HOME: %SAXON_HOME%"
318
+ )
319
+ )
320
+
321
+ set CP=%SAXON_CP%;%XSPEC_HOME%\java
322
+
323
+ rem
324
+ rem ##
325
+ rem ## options ###################################################################
326
+ rem ##
327
+ rem
328
+
329
+ rem
330
+ rem JAR filename
331
+ rem
332
+ for %%I in ("%SAXON_CP%") do set WIN_SAXON_CP_N=%%~nI
333
+
334
+ rem
335
+ rem Parse command line
336
+ rem
337
+ call :win_reset_options
338
+ call :win_get_options %*
339
+
340
+ rem
341
+ rem # Schematron
342
+ rem # XSLT
343
+ rem
344
+ if defined SCHEMATRON if defined XSLT (
345
+ call :usage "-s and -t are mutually exclusive"
346
+ exit /b 1
347
+ )
348
+
349
+ rem
350
+ rem # Schematron
351
+ rem # XQuery
352
+ rem
353
+ if defined SCHEMATRON if defined XQUERY (
354
+ call :usage "-s and -q are mutually exclusive"
355
+ exit /b 1
356
+ )
357
+
358
+ rem
359
+ rem # XSLT
360
+ rem # XQuery
361
+ rem
362
+ if defined XSLT if defined XQUERY (
363
+ call :usage "-t and -q are mutually exclusive"
364
+ exit /b 1
365
+ )
366
+
367
+ rem
368
+ rem # Coverage
369
+ rem
370
+ if defined COVERAGE (
371
+ if /i not "%WIN_SAXON_CP_N%"=="saxon9pe" if /i not "%WIN_SAXON_CP_N%"=="saxon9ee" (
372
+ echo Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE.
373
+ exit /b 1
374
+ )
375
+ )
376
+
377
+ rem
378
+ rem # JUnit report
379
+ rem
380
+ if defined JUNIT (
381
+ if /i "%WIN_SAXON_CP_N:~0,6%"=="saxon8" (
382
+ echo Saxon8 detected. JUnit report requires Saxon9.
383
+ exit /b 1
384
+ )
385
+ )
386
+
387
+ rem
388
+ rem # Help!
389
+ rem
390
+ if defined WIN_HELP (
391
+ call :usage
392
+ exit /b 0
393
+ )
394
+
395
+ rem
396
+ rem # Unknown option!
397
+ rem
398
+ if defined WIN_UNKNOWN_OPTION (
399
+ call :usage "Error: Unknown option: %WIN_UNKNOWN_OPTION%"
400
+ exit /b 1
401
+ )
402
+
403
+ rem
404
+ rem # set XSLT if XQuery has not been set (that's the default)
405
+ rem
406
+ if not defined XSLT if not defined XQUERY set XSLT=1
407
+
408
+ if not exist "%XSPEC%" (
409
+ call :usage "Error: File not found."
410
+ exit /b 1
411
+ )
412
+
413
+ rem
414
+ rem Extra option
415
+ rem
416
+ if defined WIN_EXTRA_OPTION (
417
+ call :usage "Error: Extra option: %WIN_EXTRA_OPTION%"
418
+ exit /b 1
419
+ )
420
+
421
+ rem
422
+ rem Deprecated 'coverage' option
423
+ rem
424
+ if defined WIN_DEPRECATED_COVERAGE (
425
+ echo Long-form option 'coverage' deprecated, use '-c' instead.
426
+ if /i not "%WIN_SAXON_CP_N%"=="saxon9pe" if /i not "%WIN_SAXON_CP_N%"=="saxon9ee" (
427
+ echo Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE.
428
+ exit /b 1
429
+ )
430
+ set COVERAGE=1
431
+ )
432
+
433
+ rem
434
+ rem Env var no longer necessary
435
+ rem
436
+ set WIN_SAXON_CP_N=
437
+
438
+ rem
439
+ rem ##
440
+ rem ## files and dirs ############################################################
441
+ rem ##
442
+ rem
443
+
444
+ if not defined TEST_DIR for %%I in ("%XSPEC%") do set TEST_DIR=%%~dpIxspec
445
+ for %%I in ("%XSPEC%") do set TARGET_FILE_NAME=%%~nI
446
+
447
+ if defined XSLT (
448
+ set "COMPILED=%TEST_DIR%\%TARGET_FILE_NAME%.xsl"
449
+ ) else (
450
+ set "COMPILED=%TEST_DIR%\%TARGET_FILE_NAME%.xq"
451
+ )
452
+ set COVERAGE_XML=%TEST_DIR%\%TARGET_FILE_NAME%-coverage.xml
453
+ set COVERAGE_HTML=%TEST_DIR%\%TARGET_FILE_NAME%-coverage.html
454
+ set RESULT=%TEST_DIR%\%TARGET_FILE_NAME%-result.xml
455
+ set HTML=%TEST_DIR%\%TARGET_FILE_NAME%-result.html
456
+ set JUNIT_RESULT=%TEST_DIR%\%TARGET_FILE_NAME%-junit.xml
457
+ set COVERAGE_CLASS=com.jenitennison.xslt.tests.XSLTCoverageTraceListener
458
+
459
+ if not exist "%TEST_DIR%" (
460
+ call :win_echo "Creating XSpec Directory at %TEST_DIR%..."
461
+ mkdir "%TEST_DIR%"
462
+ echo:
463
+ )
464
+
465
+ rem
466
+ rem ##
467
+ rem ## compile the suite #########################################################
468
+ rem ##
469
+ rem
470
+
471
+ if defined SCHEMATRON call :schematron_compile || goto :win_main_error_exit
472
+
473
+ if defined XSLT (
474
+ set COMPILE_SHEET=generate-xspec-tests.xsl
475
+ ) else (
476
+ set COMPILE_SHEET=generate-query-tests.xsl
477
+ )
478
+ echo Creating Test Stylesheet...
479
+ call :xslt -o:"%COMPILED%" -s:"%XSPEC%" ^
480
+ -xsl:"%XSPEC_HOME%\src\compiler\%COMPILE_SHEET%" ^
481
+ || ( call :die "Error compiling the test suite" & goto :win_main_error_exit )
482
+ echo:
483
+
484
+ rem
485
+ rem ##
486
+ rem ## run the suite #############################################################
487
+ rem ##
488
+ rem
489
+
490
+ echo Running Tests...
491
+ if defined XSLT (
492
+ rem
493
+ rem # for XSLT
494
+ rem
495
+ if defined COVERAGE (
496
+ echo Collecting test coverage data; suppressing progress report...
497
+ call :win_xslt_trace -T:%COVERAGE_CLASS% ^
498
+ -o:"%RESULT%" -s:"%XSPEC%" -xsl:"%COMPILED%" ^
499
+ -it:{http://www.jenitennison.com/xslt/xspec}main 2> "%COVERAGE_XML%" ^
500
+ || ( call :die "Error collecting test coverage data" & goto :win_main_error_exit )
501
+ ) else (
502
+ call :xslt -o:"%RESULT%" -s:"%XSPEC%" -xsl:"%COMPILED%" ^
503
+ -it:{http://www.jenitennison.com/xslt/xspec}main ^
504
+ || ( call :die "Error running the test suite" & goto :win_main_error_exit )
505
+ )
506
+ ) else (
507
+ rem
508
+ rem # for XQuery
509
+ rem
510
+ if defined COVERAGE (
511
+ echo Collecting test coverage data; suppressing progress report...
512
+ call :win_xquery_trace -T:%COVERAGE_CLASS% ^
513
+ -o:"%RESULT%" -s:"%XSPEC%" "%COMPILED%" 2> "%COVERAGE_XML%" ^
514
+ || ( call :die "Error collecting test coverage data" & goto :win_main_error_exit )
515
+ ) else (
516
+ call :xquery -o:"%RESULT%" -s:"%XSPEC%" "%COMPILED%" ^
517
+ || ( call :die "Error running the test suite" & goto :win_main_error_exit )
518
+ )
519
+ )
520
+
521
+ rem
522
+ rem ##
523
+ rem ## format the report #########################################################
524
+ rem ##
525
+ rem
526
+
527
+ echo:
528
+ echo Formatting Report...
529
+ call :xslt -o:"%HTML%" ^
530
+ -s:"%RESULT%" ^
531
+ -xsl:"%XSPEC_HOME%\src\reporter\format-xspec-report.xsl" ^
532
+ inline-css=true ^
533
+ || ( call :die "Error formatting the report" & goto :win_main_error_exit )
534
+
535
+ rem
536
+ rem Absolute path of the XSPEC env var
537
+ rem
538
+ for %%I in ("%XSPEC%") do set WIN_XSPEC_ABS=%%~fI
539
+
540
+ if defined COVERAGE (
541
+ rem
542
+ rem For $tests and $pwd, convert the native file path to a wannabe-
543
+ rem URI. The peculiar implementation of Java prefers the following
544
+ rem forms (if it's absolute).
545
+ rem
546
+ rem For drive: file:/c:/dir/file
547
+ rem For UNC: file:////host/share/dir/file
548
+ rem
549
+ rem Note that in terms of the native file path, coverage-report.xsl
550
+ rem handles $tests and $pwd differently.
551
+ rem
552
+ rem Scheme ('file:')
553
+ rem
554
+ rem $tests
555
+ rem The XSPEC env var may be absolute or relative. If
556
+ rem relative, we need to omit 'file:' from $tests.
557
+ rem For simplicity, we always obtain the absolute path of
558
+ rem the XSPEC env var and prefix it with 'file:'.
559
+ rem
560
+ rem $pwd
561
+ rem The CD env var is always absolute. So we always prefix
562
+ rem it with 'file:'.
563
+ rem
564
+ rem '\' character
565
+ rem
566
+ rem $tests
567
+ rem coverage-report.xsl replaces '\' with '/'. You can
568
+ rem leave '\' intact here.
569
+ rem
570
+ rem $pwd
571
+ rem coverage-report.xsl does nothing. You have to replace
572
+ rem '\' with '/' here.
573
+ rem
574
+ rem UNC
575
+ rem
576
+ rem $tests
577
+ rem You have to care about UNC.
578
+ rem
579
+ rem $pwd
580
+ rem You don't have to care about UNC. By default CMD.EXE
581
+ rem does not accept UNC as the current directory.
582
+ rem
583
+ rem We don't escape any characters here. Too much for this simple
584
+ rem batch script. Fortunately Saxon 9.7 seems to be more tolerant of
585
+ rem space chars than 9.6.
586
+ rem
587
+ call :xslt -l:on ^
588
+ -o:"%COVERAGE_HTML%" ^
589
+ -s:"%COVERAGE_XML%" ^
590
+ -xsl:"%XSPEC_HOME%\src\reporter\coverage-report.xsl" ^
591
+ tests="file:/%WIN_XSPEC_ABS:\\=/\\%" ^
592
+ pwd="file:/%CD:\=/%/" ^
593
+ || ( call :die "Error formating the coverage report" & goto :win_main_error_exit )
594
+ call :win_echo "Report available at %COVERAGE_HTML%"
595
+ rem %OPEN% "%COVERAGE_HTML%"
596
+ ) else if defined JUNIT (
597
+ call :xslt -o:"%JUNIT_RESULT%" ^
598
+ -s:"%RESULT%" ^
599
+ -xsl:"%XSPEC_HOME%\src\reporter\junit-report.xsl" ^
600
+ || ( call :die "Error formating the JUnit report" & goto :win_main_error_exit )
601
+ call :win_echo "Report available at %JUNIT_RESULT%"
602
+ ) else (
603
+ call :win_echo "Report available at %HTML%"
604
+ rem %OPEN% "%HTML%"
605
+ )
606
+
607
+ call :cleanup
608
+
609
+ echo Done.
610
+ exit /b
611
+
612
+ rem
613
+ rem Error exit ###################################################################
614
+ rem
615
+ :win_main_error_exit
616
+ if errorlevel 1 (
617
+ exit /b %ERRORLEVEL%
618
+ ) else (
619
+ exit /b 1
620
+ )