From 8affb84ff759aa1cd44fec8ae04d6a83987ebf52 Mon Sep 17 00:00:00 2001 From: Anil Kumar Myla Date: Fri, 13 Sep 2019 22:36:30 -0700 Subject: [PATCH] Add integration tests --- integration-test/src/test/scala/RunnerTest.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/integration-test/src/test/scala/RunnerTest.scala b/integration-test/src/test/scala/RunnerTest.scala index 30cca6b5e..c5c1d4c80 100644 --- a/integration-test/src/test/scala/RunnerTest.scala +++ b/integration-test/src/test/scala/RunnerTest.scala @@ -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"))