Home | History | Annotate | Download | only in openjdk-integ-tests
      1 import org.codehaus.groovy.runtime.InvokerHelper
      2 
      3 description = 'Conscrypt: OpenJDK Integration Tests'
      4 
      5 evaluationDependsOn(':conscrypt-openjdk')
      6 
      7 def preferredSourceSet = project(':conscrypt-openjdk').preferredSourceSet
      8 def preferredNativeFileDir = project(':conscrypt-openjdk').preferredNativeFileDir
      9 
     10 sourceSets {
     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 
     19 dependencies {
     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
     30 def javaError = new ByteArrayOutputStream()
     31 exec {
     32     executable test.executable
     33     args = ['-version']
     34     ignoreExitValue true
     35     errorOutput = javaError
     36 }
     37 
     38 def suiteClass = (javaError.toString() =~ /"1[.]7[.].*"/) ?
     39     "org/conscrypt/ConscryptJava7Suite.class" : "org/conscrypt/ConscryptSuite.class";
     40 
     41 test {
     42     include suiteClass
     43 }
     44 
     45 task 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 }
     51 check.dependsOn testEngineSocket
     52 
     53 // Don't include this artifact in the distribution.
     54 tasks.install.enabled = false
     55 tasks.uploadArchives.enabled = false;
     56