diff options
author | vsalvis <salvisbergvera@gmail.com> | 2015-05-13 12:18:39 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-13 12:50:12 +0200 |
commit | e9e394093e4cb885ce11d597cd94b4c8f1a0e0ae (patch) | |
tree | 3d06e822abe85b399dc3d6a96a9eb4dff9ffb9f8 /test/dotty/partest/DPConsoleRunner.scala | |
parent | cb5b6a0d85be25b76946b8bfc6821c7e399463a6 (diff) | |
download | dotty-e9e394093e4cb885ce11d597cd94b4c8f1a0e0ae.tar.gz dotty-e9e394093e4cb885ce11d597cd94b4c8f1a0e0ae.tar.bz2 dotty-e9e394093e4cb885ce11d597cd94b4c8f1a0e0ae.zip |
Partest command line options (same as scala) useable from sbt
Diffstat (limited to 'test/dotty/partest/DPConsoleRunner.scala')
-rw-r--r-- | test/dotty/partest/DPConsoleRunner.scala | 13 |
1 files changed, 8 insertions, 5 deletions
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 <count> <jar1> <jar2> ... 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 <jarCount> <jars>*\".") 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), |