Add integration tests

This commit is contained in:
Anil Kumar Myla 2019-09-13 22:36:30 -07:00
parent 2946025d75
commit 8affb84ff7
No known key found for this signature in database
GPG Key ID: BC80B8B017F64FC7
1 changed files with 7 additions and 4 deletions

View File

@ -9,10 +9,7 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
lazy val sbtScript =
if (isWindows) new File("target/universal/stage/bin/sbt.bat")
else new File("target/universal/stage/bin/sbt")
def sbtProcess(arg: String) =
sbt.internal.Process(sbtScript.getAbsolutePath + " " + arg, new File("citest"),
"JAVA_OPTS" -> "",
"SBT_OPTS" -> "")
def sbtProcess(arg: String) = sbtProcessWithOpts(arg, "", "")
def sbtProcessWithOpts(arg: String, javaOpts: String, sbtOpts: String) =
sbt.internal.Process(sbtScript.getAbsolutePath + " " + arg, new File("citest"),
"JAVA_OPTS" -> javaOpts,
@ -55,6 +52,12 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
()
}
test("sbt --sbt-version") {
val out = sbtProcess("--sbt-version 1.3.0 compile -v").!!.linesIterator.toList
assert(out.contains[String]("-Dsbt.version=1.3.0"))
()
}
test("sbt -mem 503") {
val out = sbtProcess("compile -mem 503 -v").!!.linesIterator.toList
assert(out.contains[String]("-Xmx503m"))