[K/N] Add a trivial test coverage for use Foundation

This commit is contained in:
Sergey Bogolepov
2023-01-31 17:26:12 +02:00
committed by Space Team
parent ba4ba27afd
commit 02c46d17aa
2 changed files with 23 additions and 0 deletions
@@ -6088,6 +6088,21 @@ if (isAppleTarget(project)) {
}
swiftSources = ['framework/forwardDeclarations/']
}
frameworkTest("testFrameworkUsesFoundationModule") {
framework("Bar") {
sources = ["framework/use_foundation_module/framework.kt"]
}
swiftSources = []
doLast {
def frameworkPath = "$testOutputFramework/testFrameworkUsesFoundationModule/$target/Bar.framework"
def moduleMapContent = file("$frameworkPath/Modules/module.modulemap").text
def useFoundationPattern = ~"use Foundation"
if (!useFoundationPattern.matcher(moduleMapContent).find()) {
throw new Error("Expected use of Foundation module:\n$moduleMapContent")
}
}
}
}
/**
@@ -0,0 +1,8 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package shared
fun shared() {}