2019-02-22 23:48:37 +01:00
|
|
|
package example.test
|
|
|
|
|
|
|
|
|
|
import minitest._
|
|
|
|
|
import scala.sys.process._
|
|
|
|
|
import java.io.File
|
|
|
|
|
|
|
|
|
|
object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
|
|
|
|
|
lazy val sbtScript = new File("target/universal/stage/bin/sbt")
|
|
|
|
|
def sbtProcess(arg: String) =
|
2019-02-23 04:31:58 +01:00
|
|
|
sbt.internal.Process(sbtScript.getAbsolutePath + " " + arg, new File("citest"),
|
|
|
|
|
"JAVA_OPTS" -> "",
|
|
|
|
|
"SBT_OPTS" -> "")
|
|
|
|
|
def sbtProcessWithOpts(arg: String) =
|
|
|
|
|
sbt.internal.Process(sbtScript.getAbsolutePath + " " + arg, new File("citest"),
|
|
|
|
|
"JAVA_OPTS" -> "-Xmx1024m",
|
|
|
|
|
"SBT_OPTS" -> "")
|
2019-02-22 23:48:37 +01:00
|
|
|
|
|
|
|
|
test("sbt runs") {
|
|
|
|
|
assert(sbtScript.exists)
|
|
|
|
|
val out = sbtProcess("compile -v").!
|
|
|
|
|
assert(out == 0)
|
|
|
|
|
()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test("sbt -no-colors") {
|
|
|
|
|
val out = sbtProcess("compile -no-colors -v").!!.linesIterator.toList
|
|
|
|
|
assert(out.contains[String]("-Dsbt.log.noformat=true"))
|
|
|
|
|
()
|
|
|
|
|
}
|
2019-02-23 04:31:58 +01:00
|
|
|
|
2019-04-05 16:20:52 +02:00
|
|
|
test("sbt --no-colors") {
|
|
|
|
|
val out = sbtProcess("compile --no-colors -v").!!.linesIterator.toList
|
|
|
|
|
assert(out.contains[String]("-Dsbt.log.noformat=true"))
|
|
|
|
|
()
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-23 04:31:58 +01:00
|
|
|
test("sbt -mem 503") {
|
|
|
|
|
val out = sbtProcess("compile -mem 503 -v").!!.linesIterator.toList
|
|
|
|
|
assert(out.contains[String]("-Xmx503m"))
|
|
|
|
|
()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test("sbt -mem 503 with JAVA_OPTS") {
|
|
|
|
|
val out = sbtProcessWithOpts("compile -mem 503 -v").!!.linesIterator.toList
|
|
|
|
|
assert(out.contains[String]("-Xmx503m"))
|
|
|
|
|
()
|
|
|
|
|
}
|
2019-02-22 23:48:37 +01:00
|
|
|
}
|