mirror of https://github.com/sbt/sbt.git
add test
This commit is contained in:
parent
73bd7a5284
commit
49d85750af
|
|
@ -23,5 +23,7 @@ install:
|
|||
|
||||
test_script:
|
||||
- sbt "-Dsbt.build.version=1.0.4" universal:packageBin
|
||||
- unzip target\universal\sbt.zip -d target\freshly-baked\
|
||||
- citest\test.bat
|
||||
- cd citest
|
||||
- test.bat
|
||||
- test1.bat
|
||||
- test2.bat
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
lazy val check = taskKey[Unit]("")
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.settings(
|
||||
scalaVersion := "2.12.4",
|
||||
name := "Hello",
|
||||
check := {
|
||||
val xs = IO.readLines(file("output.txt")).toVector
|
||||
|
||||
println(xs)
|
||||
|
||||
assert(xs(0) startsWith "Copying runtime jar.")
|
||||
// echo of jar name
|
||||
assert(xs(2) startsWith "[info] Loading project definition")
|
||||
assert(xs(3) startsWith "[info] Loading settings from build.sbt")
|
||||
assert(xs(4) startsWith "[info] Set current project to Hello")
|
||||
assert(xs(5) startsWith "[info] This is sbt")
|
||||
assert(xs(6) startsWith "[info] The current project")
|
||||
assert(xs(7) startsWith "[info] The current project is built against Scala 2.12.4")
|
||||
|
||||
val ys = IO.readLines(file("err.txt")).toVector
|
||||
|
||||
println(ys)
|
||||
|
||||
assert(ys.size == 4)
|
||||
assert(ys(0) startsWith "Error: Unable to access jarfile")
|
||||
assert(ys(1) startsWith "The filename, directory name, or volume label syntax is incorrect.")
|
||||
assert(ys(2) startsWith "Error: Unable to access jarfile")
|
||||
assert(ys(3) startsWith "Java HotSpot(TM) 64-Bit Server VM warning")
|
||||
}
|
||||
)
|
||||
|
|
@ -0,0 +1 @@
|
|||
sbt.version=1.0.4
|
||||
|
|
@ -1,6 +1,16 @@
|
|||
@echo on
|
||||
|
||||
cd "%~dp0"
|
||||
|
||||
mkdir freshly-baked
|
||||
unzip ..\target\universal\sbt.zip -d freshly-baked
|
||||
|
||||
SETLOCAL
|
||||
|
||||
SET JAVA_HOME=C:\jdk9
|
||||
SET PATH=C:\jdk9\bin;%PATH%
|
||||
SET SBT_OPTS=-Xmx4g -Dfile.encoding=UTF8
|
||||
|
||||
"..\target\freshly-baked\sbt\bin\sbt" about
|
||||
"freshly-baked\sbt\bin\sbt" about
|
||||
|
||||
ENDLOCAL
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
@echo on
|
||||
|
||||
SETLOCAL
|
||||
|
||||
SET JAVA_HOME=C:\jdk9
|
||||
SET PATH=C:\jdk9\bin;%PATH%
|
||||
SET SBT_OPTS=-Xmx4g -Dfile.encoding=UTF8
|
||||
|
||||
"freshly-baked\sbt\bin\sbt" about 1> output.txt 2> err.txt
|
||||
|
||||
ENDLOCAL
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
@echo on
|
||||
|
||||
SETLOCAL
|
||||
|
||||
SET JAVA_HOME=C:\jdk9
|
||||
SET PATH=C:\jdk9\bin;%PATH%
|
||||
SET SBT_OPTS=-Xmx4g -Dfile.encoding=UTF8
|
||||
|
||||
"freshly-baked\sbt\bin\sbt" check
|
||||
|
||||
ENDLOCAL
|
||||
Loading…
Reference in New Issue