• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import org.codehaus.groovy.runtime.InvokerHelper
2
3description = 'Conscrypt: OpenJDK Integration Tests'
4
5evaluationDependsOn(':conscrypt-openjdk')
6
7def preferredSourceSet = project(':conscrypt-openjdk').preferredSourceSet
8def preferredNativeFileDir = project(':conscrypt-openjdk').preferredNativeFileDir
9
10sourceSets {
11    main {
12        resources {
13            // This shouldn't be needed but seems to help IntelliJ locate the native artifact.
14            srcDirs += preferredNativeFileDir
15        }
16    }
17}
18
19dependencies {
20    implementation project(':conscrypt-openjdk')
21
22    // Add the preferred native openjdk configuration for this platform.
23    implementation project(':conscrypt-openjdk').sourceSets["$preferredSourceSet"].output
24
25    testImplementation project(':conscrypt-constants'),
26                       project(':conscrypt-testing')
27}
28
29// Check which version
30def javaError = new ByteArrayOutputStream()
31exec {
32    executable test.executable
33    args = ['-version']
34    ignoreExitValue true
35    errorOutput = javaError
36}
37
38def suiteClass = (javaError.toString() =~ /"1[.]7[.].*"/) ?
39    "org/conscrypt/ConscryptJava7Suite.class" : "org/conscrypt/ConscryptSuite.class";
40
41test {
42    include suiteClass
43}
44
45task testEngineSocket(type: Test, dependsOn: test) {
46    jvmArgs "-Dorg.conscrypt.useEngineSocketByDefault=true"
47    include suiteClass
48    InvokerHelper.setProperties(testLogging, test.testLogging.properties)
49    systemProperties = test.systemProperties
50}
51check.dependsOn testEngineSocket
52
53// Don't include this artifact in the distribution.
54tasks.install.enabled = false
55tasks.uploadArchives.enabled = false;
56