Project

Profile

Help

Revision b2ef1409

Added by Norman Tovey-Walsh 5 months ago

Fix bugs in XSD test suites; add test suite report

View differences:

test-suites.gradle
18 18
  // Just somewhere to hang dependencies
19 19
}
20 20

  
21
// This task will generate the test suite report from
22
// whatever results are lying around
23
task testSuiteReportsJava(
24
  type: JavaExec
25
) {
26
  def rundate = project.findProperty('rundate')
27

  
28
  inputs.files fileTree(dir: "${buildDir}/test-results")
29
  inputs.file "${projectDir}/tools/test-suites/report.xsl"
30
  outputs.file "${buildDir}/report.xml"
31
  outputs.file "${buildDir}/report.html"
32
  classpath = configurations.preprocessor
33
  workingDir = buildDir
34
  main = "net.sf.saxon.Transform"
35

  
36
  def arglist = ["-it:main",
37
                 "-xsl:${projectDir}/tools/test-suites/report.xsl",
38
                 "-ns:##any"]
39

  
40
  if (rundate != null) {
41
    arglist += ["rundate=${rundate}"]
42
  }
43
  
44
  args arglist
45
}
46

  
47
// This task *runs all the tests* and then generates the
48
// test suite report from the results
49
task runTestSuiteReportsJava(
50
  type: JavaExec,
51
  dependsOn: ["testSuitesJava"]
52
) {
53
  def rundate = project.findProperty('rundate')
54

  
55
  inputs.files fileTree(dir: "${buildDir}/test-results")
56
  inputs.file "${projectDir}/tools/test-suites/report.xsl"
57
  outputs.file "${buildDir}/report.xml"
58
  outputs.file "${buildDir}/report.html"
59
  classpath = configurations.preprocessor
60
  workingDir = buildDir
61
  main = "net.sf.saxon.Transform"
62

  
63
  def arglist = ["-it:main",
64
                 "-xsl:${projectDir}/tools/test-suites/report.xsl",
65
                 "-ns:##any"]
66

  
67
  if (rundate != null) {
68
    arglist += ["rundate=${rundate}"]
69
  }
70
  
71
  args arglist
72
}
73

  
21 74
// ============================================================
22 75

  
23 76
def langCodeMap = ["XP20": "XPath2.0",
......
42 95
    def pos = fn.toString().lastIndexOf(pathSeparator)
43 96
    def base = fn.toString().substring(pos+1)
44 97
    base = base.substring(0, base.length() - 4)
45
    task "${release}j_setup_${base}_TestResults"(
46
      type: Copy,
47
      description: "Sets up the test results directory the ${base} tests for ${RELEASE}"
48
    ) {
49
      into "${buildDir}/test-results/${release}j/${base}/${DSTAMP}"
50
      from "src/test/exceptions/${base}.xml"
51
      rename { "exceptions.xml" }
98

  
99
    def schema11 = (base == "xsd11" || base == "xsd-extra11")
100
    def schema = schema11 || (base == "xsd" || base == "xsd-extra")
101
    if (schema11 && release == "ee") {
102
      // These are a special case, they need to be renamed 'exceptions11.xml'
103
      // in the corresponding base directory. See "dependsOn" below this loop.
104
      def bdir = "xsd"
105
      if (base == "xsd-extra11") {
106
        bdir = "xsd-extra"
107
      }
108
      task "${release}j_setup_${base}_TestResults"(
109
        type: Copy,
110
        description: "Sets up the test results directory the ${base} tests for ${RELEASE}"
111
      ) {
112
        into "${buildDir}/test-results/${release}j/${bdir}/${DSTAMP}"
113
        from "src/test/exceptions/${base}.xml"
114
        rename { "exceptions11.xml" }
115
      }
116
    } else {
117
      // The schema tests only run on EE
118
      if (!schema || release == "ee") {
119
        task "${release}j_setup_${base}_TestResults"(
120
          type: Copy,
121
          description: "Sets up the test results directory the ${base} tests for ${RELEASE}"
122
        ) {
123
          into "${buildDir}/test-results/${release}j/${base}/${DSTAMP}"
124
          from "src/test/exceptions/${base}.xml"
125
          rename { "exceptions.xml" }
126
        }
127
      }
52 128
    }
53 129
  }
54 130

  
......
63 139
  }
64 140
}
65 141

  
142
tasks.findByName("eej_setup_xsd_TestResults").dependsOn "eej_setup_xsd11_TestResults"
143
tasks.findByName("eej_setup_xsd-extra_TestResults").dependsOn "eej_setup_xsd-extra11_TestResults"
144

  
66 145
task eej_setup_xsd_transformations(
67 146
  type: Copy,
68 147
  description: "Copy the transformations used by the XSD test driver"
......
474 553
        description: "Run the XSD test suite driver for ${RELEASE}/${language}/${bytecode}"
475 554
      ) {
476 555
        inputs.files fileTree(dir: "src")
477
        outputs.file "${resdir}/results_XSLT3.0_${saxonVersion}.xml"
556
        outputs.file "${resdir}/SaxonFailures${saxonVersion}.xml"
557
        outputs.file "${resdir}/SaxonResults${saxonVersion}-${language}.xml"
478 558

  
479 559
        classpath = configurations.testDrivers \
480 560
        + files("${buildDir}/classes/${release}j") \
......
482 562

  
483 563
        main = "${jpackage}.SchemaTestSuiteDriver"
484 564
        def testargs = [w3cXsdTestSuiteDir,
485
                        "catalog.xml",
486
                        "-v:${language}",
487 565
                        "-local:${resdir}",
488
                        "-lang:${language}"]
566
                        "-v:${language}"]
489 567
        if (bytecode != "") {
490 568
          testargs += [ "-bytecode:${bytecode}" ]
491 569
        }

Also available in: Unified diff