blob: 6fa09926ed287c0b27f99f737e5a2f35c985c40b [file] [edit]
plugins {
id 'rhino.java-conventions'
id 'jacoco'
id 'jacoco-report-aggregation'
}
dependencies {
implementation project(':rhino-engine')
implementation project(':examples')
implementation project(':rhino')
implementation project(':rhino-tools')
implementation project(':rhino-xml')
testImplementation project(':testutils')
testImplementation("com.tngtech.archunit:archunit-junit4:1.4.1") {
exclude group: 'junit'
}
testImplementation("org.slf4j:slf4j-simple:2.0.17")
testImplementation "org.yaml:snakeyaml:2.5"
testImplementation "javax.xml.soap:javax.xml.soap-api:1.4.0"
testImplementation "javax.activation:javax.activation-api:1.2.0"
}
tasks.withType(JavaCompile) {
// We have deprecated things, like "optimization level", and have
// not yet removed them from all tests, so turn this warning off.
options.compilerArgs = [
'-Xlint:-deprecation,unchecked'
]
}
test {
maxHeapSize = "1g"
// Many tests do not clean up contexts properly. This makes the tests much
// more resilient at the expense of performance.
forkEvery = 1
maxParallelForks = 64
// Properties required for the legacy Mozilla tests. Tests will fail unless
// the time zone and other properties are set as shown below
systemProperty 'java.awt.headless', 'true'
systemProperty 'mozilla.js.tests', 'testsrc/tests'
systemProperty 'mozilla.js.tests.timeout', 60000
// Required for JWT GUI tests
jvmArgs += ['--add-opens', 'java.desktop/javax.swing.table=ALL-UNNAMED']
// Required for some reflection tests
jvmArgs += ['--add-opens', 'java.base/java.util=ALL-UNNAMED']
jvmArgs += ['--add-opens', 'java.base/java.lang=ALL-UNNAMED']
systemProperty 'test262properties', System.getProperty('test262properties')
if (System.getProperty('updateTest262properties') != null) {
if (System.getenv("RHINO_TEST_JAVA_VERSION") != "11") {
System.out.println("Test262 properties update is only accurate on Java 11 and you have " + JavaVersion.current())
System.out.println("Set RHINO_TEST_JAVA_VERSION in the environment to use this feature")
throw new Exception("Incorrect Java version for Test 262 properties update")
}
systemProperty 'updateTest262properties', System.getProperty('updateTest262properties')
}
System.properties.each { k,v->
if (k.startsWith("rhino.")) {
systemProperty k, v
}
}
jacoco {
// These particular tests produce Jacoco exceptions because of their size
excludes = ['**perlstress**', '**start_unicode**', '**ojsc**']
}
}
jacocoTestReport {
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir('reports/jacoco')
}
}