From e9e394093e4cb885ce11d597cd94b4c8f1a0e0ae Mon Sep 17 00:00:00 2001 From: vsalvis Date: Wed, 13 May 2015 12:18:39 +0200 Subject: Partest command line options (same as scala) useable from sbt --- test/dotty/partest/DPConsoleRunner.scala | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/dotty/partest/DPConsoleRunner.scala b/test/dotty/partest/DPConsoleRunner.scala index 31b8467d3..1f3eaa39d 100644 --- a/test/dotty/partest/DPConsoleRunner.scala +++ b/test/dotty/partest/DPConsoleRunner.scala @@ -23,21 +23,24 @@ object DPConsoleRunner { // extra jars for run tests are passed with -dottyJars ... val jarFinder = """-dottyJars (\d*) (.*)""".r val (jarList, otherArgs) = args.toList.partition(jarFinder.findFirstIn(_).isDefined) - val extraJars = jarList match { + val (extraJars, moreArgs) = jarList match { case Nil => sys.error("Error: DPConsoleRunner needs \"-dottyJars *\".") case jarFinder(nr, jarString) :: Nil => val jars = jarString.split(" ").toList - if (jars.length.toString != nr) - sys.error("Error: DPConsoleRunner found wrong number of dottyJars: " + jars + ", expected: " + nr + ". Make sure the path doesn't contain any spaces.") - else jars + val count = nr.toInt + if (jars.length < count) + sys.error("Error: DPConsoleRunner found wrong number of dottyJars: " + jars + ", expected: " + nr) + else (jars.take(count), jars.drop(count)) case list => sys.error("Error: DPConsoleRunner found several -dottyJars options: " + list) } - new DPConsoleRunner(otherArgs mkString (" "), extraJars).runPartest + new DPConsoleRunner((otherArgs ::: moreArgs) mkString (" "), extraJars).runPartest } } // console runner has a suite runner which creates a test runner for each test class DPConsoleRunner(args: String, extraJars: List[String]) extends ConsoleRunner(args) { + println("ConsoleRunner options: " + args) + override val suiteRunner = new DPSuiteRunner ( testSourcePath = optSourcePath getOrElse DPConfig.testRoot, fileManager = new DottyFileManager(extraJars), -- cgit v1.2.3