1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Fix tests for Windows.

This commit is contained in:
Cedric Beust 2017-03-22 22:22:30 -07:00
parent ed34482aac
commit 18e61fc7a3
3 changed files with 7 additions and 5 deletions

View file

@ -86,4 +86,8 @@ open class BaseTest(val compilerFactory: BuildFileCompiler.IFactory? = null) {
return compilerFactory!!.create(listOf(thisBuildFile), pluginInfo).compileBuildFiles(args,
forceRecompile = true)
}
}
fun createTemporaryProjectDirectory() = Files.createTempDirectory("kobaltTest").toFile().path
.replace("\\", "/")
}

View file

@ -11,7 +11,6 @@ import org.assertj.core.api.Assertions.assertThat
import org.testng.annotations.DataProvider
import org.testng.annotations.Guice
import org.testng.annotations.Test
import java.nio.file.Files
import java.util.*
@Guice(modules = arrayOf(TestModule::class))
@ -19,7 +18,7 @@ class ProfileTest @Inject constructor(compilerFactory: BuildFileCompiler.IFactor
private fun runTestWithProfile(enabled: Boolean) : Project {
val projectVal = "p" + Math.abs(Random().nextInt())
val projectDirectory = Files.createTempDirectory("kobaltTest").toFile().path
val projectDirectory = createTemporaryProjectDirectory()
fun buildFileString(): String {
return """

View file

@ -13,7 +13,6 @@ import org.assertj.core.api.Assertions.assertThat
import org.eclipse.aether.util.filter.AndDependencyFilter
import org.testng.annotations.Guice
import org.testng.annotations.Test
import java.nio.file.Files
@Guice(modules = arrayOf(TestModule::class))
class DependencyManagerTest @Inject constructor(val dependencyManager: DependencyManager,
@ -107,7 +106,7 @@ class DependencyManagerTest @Inject constructor(val dependencyManager: Dependenc
}
private fun findDependentProject(): Project {
val projectDirectory = Files.createTempDirectory("kobaltTest").toFile().path
val projectDirectory = createTemporaryProjectDirectory()
val sharedBuildFile = """
import com.beust.kobalt.*