aboutsummaryrefslogtreecommitdiff
path: root/test/test.scala
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2016-04-02 16:06:40 -0400
committerJan Christopher Vogt <oss.nsp@cvogt.org>2016-04-02 16:06:40 -0400
commit63b54f79c10854e38b2a4a43ee39f508458e280f (patch)
tree6a5791efedc2d297cfac1ad8bbaac0b090105149 /test/test.scala
parent16b02cf34078113c833225297b686752aa26b407 (diff)
parentefe68c7e710aa8c54144715408b7faca36f52c27 (diff)
downloadcbt-63b54f79c10854e38b2a4a43ee39f508458e280f.tar.gz
cbt-63b54f79c10854e38b2a4a43ee39f508458e280f.tar.bz2
cbt-63b54f79c10854e38b2a4a43ee39f508458e280f.zip
Rewrite CBT's classloading and dependency classloaders, fetch zinc early and various smaller changes
Rewrite CBT's classloading and dependency classloaders, fetch zinc early and various smaller changes
Diffstat (limited to 'test/test.scala')
-rw-r--r--test/test.scala24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/test.scala b/test/test.scala
index 47bd28b..7261287 100644
--- a/test/test.scala
+++ b/test/test.scala
@@ -4,9 +4,9 @@ import scala.collection.immutable.Seq
// micro framework
object Main{
- def main(args: Array[String]): Unit = {
- val init = new Init(args)
- implicit val logger: Logger = init.logger
+ def main(_args: Array[String]): Unit = {
+ val args = new Stage1ArgsParser(_args.toVector)
+ implicit val logger: Logger = new Logger(args.enabledLoggers)
var successes = 0
var failures = 0
@@ -24,9 +24,9 @@ object Main{
}.get
}
- def runCbt(path: String, args: Seq[String])(implicit logger: Logger): Result = {
+ def runCbt(path: String, _args: Seq[String])(implicit logger: Logger): Result = {
import java.io._
- val allArgs: Seq[String] = ((cbtHome.string ++ "/cbt") +: "direct" +: (args ++ init.propsRaw))
+ val allArgs: Seq[String] = ((cbtHome.string ++ "/cbt") +: "direct" +: (_args ++ args.propsRaw))
logger.test(allArgs.toString)
val pb = new ProcessBuilder( allArgs :_* )
pb.directory(cbtHome ++ ("/test/" ++ path))
@@ -41,7 +41,7 @@ object Main{
}
case class Result(exit0: Boolean, out: String, err: String)
def assertSuccess(res: Result, msg: => String)(implicit logger: Logger) = {
- assert(res.exit0, msg + res.toString)
+ assert(res.exit0, msg ++ res.toString)
}
// tests
@@ -49,19 +49,19 @@ object Main{
val usageString = "Methods provided by CBT"
val res = runCbt(path, Seq())
logger.test(res.toString)
- val debugToken = "usage " + path +" "
+ val debugToken = "usage " ++ path ++ " "
assertSuccess(res,debugToken)
- assert(res.out == "", debugToken+ res.toString)
- assert(res.err contains usageString, debugToken+res.toString)
+ assert(res.out == "", debugToken ++ res.toString)
+ assert(res.err contains usageString, debugToken ++ res.toString)
}
def compile(path: String)(implicit logger: Logger) = {
val res = runCbt(path, Seq("compile"))
- val debugToken = "compile " + path +" "
+ val debugToken = "compile " ++ path ++ " "
assertSuccess(res,debugToken)
// assert(res.err == "", res.err) // FIXME: enable this
}
- logger.test( "Running tests " ++ args.toList.toString )
+ logger.test( "Running tests " ++ _args.toList.toString )
usage("nothing")
compile("nothing")
@@ -71,7 +71,7 @@ object Main{
compile("simple")
{
- val noContext = Context(cbtHome ++ "/test/nothing", Seq(), logger)
+ val noContext = Context(cbtHome ++ "/test/nothing", Seq(), logger, new ClassLoaderCache(logger))
val b = new Build(noContext){
override def dependencies = Seq(
JavaDependency("net.incongru.watchservice","barbary-watchservice","1.0"),