mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Fix tests for Windows.
This commit is contained in:
parent
ed34482aac
commit
18e61fc7a3
3 changed files with 7 additions and 5 deletions
|
@ -86,4 +86,8 @@ open class BaseTest(val compilerFactory: BuildFileCompiler.IFactory? = null) {
|
||||||
return compilerFactory!!.create(listOf(thisBuildFile), pluginInfo).compileBuildFiles(args,
|
return compilerFactory!!.create(listOf(thisBuildFile), pluginInfo).compileBuildFiles(args,
|
||||||
forceRecompile = true)
|
forceRecompile = true)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
fun createTemporaryProjectDirectory() = Files.createTempDirectory("kobaltTest").toFile().path
|
||||||
|
.replace("\\", "/")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.testng.annotations.DataProvider
|
import org.testng.annotations.DataProvider
|
||||||
import org.testng.annotations.Guice
|
import org.testng.annotations.Guice
|
||||||
import org.testng.annotations.Test
|
import org.testng.annotations.Test
|
||||||
import java.nio.file.Files
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@Guice(modules = arrayOf(TestModule::class))
|
@Guice(modules = arrayOf(TestModule::class))
|
||||||
|
@ -19,7 +18,7 @@ class ProfileTest @Inject constructor(compilerFactory: BuildFileCompiler.IFactor
|
||||||
|
|
||||||
private fun runTestWithProfile(enabled: Boolean) : Project {
|
private fun runTestWithProfile(enabled: Boolean) : Project {
|
||||||
val projectVal = "p" + Math.abs(Random().nextInt())
|
val projectVal = "p" + Math.abs(Random().nextInt())
|
||||||
val projectDirectory = Files.createTempDirectory("kobaltTest").toFile().path
|
val projectDirectory = createTemporaryProjectDirectory()
|
||||||
|
|
||||||
fun buildFileString(): String {
|
fun buildFileString(): String {
|
||||||
return """
|
return """
|
||||||
|
|
|
@ -13,7 +13,6 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.eclipse.aether.util.filter.AndDependencyFilter
|
import org.eclipse.aether.util.filter.AndDependencyFilter
|
||||||
import org.testng.annotations.Guice
|
import org.testng.annotations.Guice
|
||||||
import org.testng.annotations.Test
|
import org.testng.annotations.Test
|
||||||
import java.nio.file.Files
|
|
||||||
|
|
||||||
@Guice(modules = arrayOf(TestModule::class))
|
@Guice(modules = arrayOf(TestModule::class))
|
||||||
class DependencyManagerTest @Inject constructor(val dependencyManager: DependencyManager,
|
class DependencyManagerTest @Inject constructor(val dependencyManager: DependencyManager,
|
||||||
|
@ -107,7 +106,7 @@ class DependencyManagerTest @Inject constructor(val dependencyManager: Dependenc
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun findDependentProject(): Project {
|
private fun findDependentProject(): Project {
|
||||||
val projectDirectory = Files.createTempDirectory("kobaltTest").toFile().path
|
val projectDirectory = createTemporaryProjectDirectory()
|
||||||
val sharedBuildFile = """
|
val sharedBuildFile = """
|
||||||
import com.beust.kobalt.*
|
import com.beust.kobalt.*
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue