[build] enable sanity tests (step 3)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
import shadow.org.jetbrains.kotlin.gradle.plugin.tasks.KonanCompileNativeBinary
|
||||
import org.jetbrains.kotlin.gradle.plugin.tasks.KonanCompileNativeBinary
|
||||
import org.jetbrains.kotlin.*
|
||||
import org.jetbrains.kotlin.konan.target.Family
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||
@@ -18,17 +18,10 @@ buildscript {
|
||||
url 'https://cache-redirector.jetbrains.com/maven-central'
|
||||
}
|
||||
mavenCentral()
|
||||
maven {
|
||||
url buildKotlinCompilerRepo
|
||||
}
|
||||
maven {
|
||||
url kotlinCompilerRepo
|
||||
url project.bootstrapKotlinRepo
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$gradlePluginVersion"
|
||||
}
|
||||
ext.useCustomDist = project.hasProperty("kotlin.native.home") ||
|
||||
project.hasProperty("org.jetbrains.kotlin.native.home") ||
|
||||
project.hasProperty("konan.home")
|
||||
@@ -50,18 +43,15 @@ configurations {
|
||||
cli_bc
|
||||
update_tests
|
||||
update_stdlib_tests
|
||||
}
|
||||
|
||||
repositories {
|
||||
ivy {
|
||||
ivyPattern 'https://teamcity.jetbrains.com/guestAuth/repository/download/[module]/[revision]/teamcity-ivy.xml'
|
||||
artifactPattern 'https://teamcity.jetbrains.com/guestAuth/repository/download/[module]/[revision]/[artifact](.[ext])'
|
||||
}
|
||||
compile
|
||||
nopPluginCompile
|
||||
compile.extendsFrom nopPluginCompile
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7'
|
||||
cli_bc project(path: ':backend.native', configuration: 'cli_bc')
|
||||
cli_bc project(path: ':kotlin-native:backend.native', configuration: 'cli_bc')
|
||||
def updateTestData = true
|
||||
if (project.hasProperty("kotlinProjectPath")) {
|
||||
def kotlinProj = project.property("kotlinProjectPath").toString()
|
||||
@@ -80,20 +70,6 @@ dependencies {
|
||||
println("WARNING: using stdlib tests provided by gradle.properties. Please execute :kotlin:zipTestData")
|
||||
}
|
||||
}
|
||||
if (updateTestData) {
|
||||
update_tests(group: 'org', name: 'Kotlin_KotlinPublic_Compiler', version: testKotlinCompilerVersion) {
|
||||
artifact {
|
||||
name = 'internal/kotlin-test-data'
|
||||
type = 'zip'
|
||||
}
|
||||
}
|
||||
update_stdlib_tests (group: 'org', name: 'Kotlin_KotlinPublic_Compiler', version: kotlinStdlibTestsVersion) {
|
||||
artifact {
|
||||
name = 'internal/kotlin-stdlib-tests'
|
||||
type = 'zip'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ext.testOutputRoot = rootProject.file("test.output").absolutePath
|
||||
ext.externalTestsDir = project.file("build/external")
|
||||
@@ -101,10 +77,10 @@ ext.externalStdlibTestsDir = project.file("build/stdlib_external/stdlib")
|
||||
externalTestsDir.mkdirs()
|
||||
externalStdlibTestsDir.mkdirs()
|
||||
|
||||
ext.platformManager = project.rootProject.platformManager
|
||||
ext.platformManager = project.project(":kotlin-native").platformManager
|
||||
ext.target = platformManager.targetManager(project.testTarget).target
|
||||
|
||||
ext.testLibraryDir = "${ext.kotlinNativeDist}/klib/platform/${project.target.name}"
|
||||
ext.testLibraryDir = "${ext.testOutputRoot}/klib/platform/${project.target.name}"
|
||||
|
||||
// Add executor to run tests depending on a target
|
||||
project.convention.plugins.executor = ExecutorServiceKt.create(project)
|
||||
@@ -234,7 +210,6 @@ def update_external_tests() {
|
||||
def stdlibTestsFiles = configurations.update_stdlib_tests.asFileTree
|
||||
copy {
|
||||
stdlibTestsFiles.each {
|
||||
from(zipTree(it))
|
||||
into(externalStdlibTestsDir)
|
||||
include 'common/**'
|
||||
include 'test/**'
|
||||
@@ -275,12 +250,7 @@ run {
|
||||
}
|
||||
|
||||
task sanity {
|
||||
doFirst {
|
||||
if (!project.hasProperty("test.disable_update")) {
|
||||
update_external_tests()
|
||||
}
|
||||
}
|
||||
def platformLibsTasks = targetList.collect { ":${it}PlatformLibs" } + ":distPlatformLibs"
|
||||
def platformLibsTasks = targetList.collect { ":kotlin-native:${it}PlatformLibs" } + ":distPlatformLibs"
|
||||
dependsOn(tasksOf(KonanTest) { task ->
|
||||
task.getDependsOn().every { !platformLibsTasks.contains(it) } &&
|
||||
task.name != "library_mismatch" // This test requires the wasm32 stdlib which is unavailable during a sanity run.
|
||||
@@ -2224,7 +2194,7 @@ standaloneTest("link_testLib_explicitly") {
|
||||
goldValue = "This is a side effect of a test library linked into the binary.\nYou should not be seeing this.\n\nHello\n"
|
||||
source = "link/omit/hello.kt"
|
||||
// We force library inclusion, so need to see the warning banner.
|
||||
flags = ['-l', 'testLibrary']
|
||||
flags = ['-l', 'testLibrary', '-r', testLibraryDir]
|
||||
doLast {
|
||||
def file = new File("$testLibraryDir/testLibrary")
|
||||
file.deleteDir()
|
||||
@@ -4777,7 +4747,7 @@ Task frameworkTest(String name, Closure<FrameworkTest> configurator) {
|
||||
}
|
||||
|
||||
if (!useCustomDist) {
|
||||
dependsOn ":${target.name}CrossDistRuntime", ':distCompiler'
|
||||
dependsOn ":kotlin-native:${target.name}CrossDistRuntime", ':kotlin-native:distCompiler'
|
||||
}
|
||||
|
||||
extraOpts fr.bitcode ? "-Xembed-bitcode" : "-Xembed-bitcode-marker"
|
||||
@@ -4829,7 +4799,7 @@ if (isAppleTarget(project)) {
|
||||
artifactName "test-library"
|
||||
|
||||
if (!useCustomDist) {
|
||||
dependsOn ":${target.name}CrossDistRuntime", ':distCompiler'
|
||||
dependsOn ":kotlin-native:${target.name}CrossDistRuntime", ':kotlin-native:distCompiler'
|
||||
}
|
||||
|
||||
extraOpts "-Xshort-module-name=MyLibrary"
|
||||
@@ -4856,7 +4826,7 @@ if (isAppleTarget(project)) {
|
||||
artifactName "test-library"
|
||||
|
||||
if (!useCustomDist) {
|
||||
dependsOn ":${target.name}CrossDistRuntime", ':distCompiler'
|
||||
dependsOn ":kotlin-native:${target.name}CrossDistRuntime", ':kotlin-native:distCompiler'
|
||||
}
|
||||
|
||||
extraOpts "-Xshort-module-name=MyLibrary"
|
||||
@@ -5155,11 +5125,13 @@ private void createStdlibTest(String name, boolean inWorker) {
|
||||
*/
|
||||
private void configureStdlibTest(KonanGTest task, boolean inWorker) {
|
||||
def sources = UtilsKt.getFilesToCompile(project,
|
||||
[ 'build/stdlib_external/stdlib', 'stdlib_external/utils.kt',
|
||||
'stdlib_external/collections',
|
||||
'stdlib_external/jsCollectionFactoriesActuals.kt',
|
||||
'stdlib_external/text/StringEncodingTestNative.kt'],
|
||||
[ 'build/stdlib_external/stdlib/test/internalAnnotations.kt' ])
|
||||
[ '../../../libraries/stdlib/common/test',
|
||||
'../../../libraries/stdlib/test',
|
||||
'../../../libraries/kotlin.test/common/src/test/kotlin',
|
||||
'stdlib_external/utils.kt',
|
||||
'stdlib_external/jsCollectionFactoriesActuals.kt',
|
||||
'stdlib_external/text/StringEncodingTestNative.kt'],
|
||||
[ /*'build/stdlib_external/stdlib/test/internalAnnotations.kt'*/ ])
|
||||
|
||||
konanArtifacts {
|
||||
program(task.name, targets: [target.name]) {
|
||||
@@ -5237,6 +5209,13 @@ sourceSets {
|
||||
srcDir 'debugger/src/test/kotlin'
|
||||
}
|
||||
}
|
||||
update_stdlib_tests{
|
||||
kotlin {
|
||||
srcDir '../../../libraries/stdlib/common/test'
|
||||
srcDir '../../../libraries/stdlib/test'
|
||||
srcDir '../../../libraries/kotlin.test/common/src/test/kotlin'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileNopPluginKotlin {
|
||||
@@ -5276,9 +5255,22 @@ pluginTest("runtime_basic_init", "nopPlugin") {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
nopPluginCompile kotlinCompilerModule
|
||||
compile kotlinCompilerModule
|
||||
compile project(path: ':backend.native', configuration: 'cli_bc')
|
||||
nopPluginCompile project(kotlinCompilerModule)
|
||||
nopPluginCompile project(":native:kotlin-native-utils")
|
||||
nopPluginCompile project(":core:descriptors")
|
||||
nopPluginCompile project(":compiler:ir.tree")
|
||||
nopPluginCompile project(":compiler:ir.tree.impl")
|
||||
nopPluginCompile project(":compiler:ir.backend.common")
|
||||
nopPluginCompile project(":compiler:util")
|
||||
nopPluginCompile project(":native:frontend.native")
|
||||
nopPluginCompile project(":compiler:cli-common")
|
||||
nopPluginCompile project(":compiler:cli")
|
||||
nopPluginCompile project(":kotlin-util-klib")
|
||||
nopPluginCompile project(":kotlin-util-klib-metadata")
|
||||
nopPluginCompile project(":compiler:ir.serialization.common")
|
||||
|
||||
compile project(kotlinCompilerModule)
|
||||
compile project(path: ':kotlin-native:backend.native', configuration: 'cli_bc')
|
||||
compile 'junit:junit:4.12'
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
libraryPaths = backend.native/tests/build/embedStaticLibraries
|
||||
libraryPaths = kotlin-native/backend.native/tests/build/embedStaticLibraries
|
||||
staticLibraries = 3.a 4.a
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
libraryPaths = backend.native/tests/build/kt43502
|
||||
libraryPaths = kotlin-native/backend.native/tests/build/kt43502
|
||||
staticLibraries = kt43502.a
|
||||
@@ -599,3 +599,4 @@ include ':kotlin-native:llvmDebugInfoC'
|
||||
include ':kotlin-native:utilities'
|
||||
include ':kotlin-native:platformLibs'
|
||||
include ':kotlin-native:libclangext'
|
||||
include ':kotlin-native:backend.native:tests'
|
||||
|
||||
Reference in New Issue
Block a user