[Gradle, K/N] Add test for KT-52303

This commit is contained in:
Alexander Likhachev
2022-08-18 03:41:50 +02:00
committed by Space
parent d7c1f6765e
commit 3a1d83e7c5
2 changed files with 21 additions and 0 deletions
@@ -553,6 +553,12 @@ abstract class BaseGradleIT {
return this
}
fun CompiledProject.assertDirectoryExists(path: String): CompiledProject {
assertFileExists(path)
assertTrue(fileInWorkingDir(path).isDirectory, "$path is not a directory")
return this
}
fun CompiledProject.assertFileIsSymlink(path: String = ""): CompiledProject {
assertTrue(Files.isSymbolicLink(fileInWorkingDir(path).toPath()), "The file [$path] isn't a symlink.")
return this
@@ -1147,6 +1147,21 @@ class GeneralNativeIT : BaseGradleIT() {
}
}
// KT-52303
@Test
fun testBuildDirChangeAppliedToBinaries() = with(transformNativeTestProjectWithPluginDsl("executables", directoryPrefix = "native-binaries")) {
gradleBuildScript().appendText(
"""
project.buildDir = file("${'$'}{project.buildDir.absolutePath}/mydir")
""".trimIndent()
)
build(":linkDebugExecutableHost") {
assertSuccessful()
assertDirectoryExists("build/mydir/bin/host/debugExecutable")
assertNoSuchFile("build/bin")
}
}
companion object {
fun List<String>.containsSequentially(vararg elements: String): Boolean {
check(elements.isNotEmpty())