diff options
Diffstat (limited to 'project/build')
-rwxr-xr-x | project/build/Partest.scala | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/project/build/Partest.scala b/project/build/Partest.scala index 5a6cdc2506..009064c005 100755 --- a/project/build/Partest.scala +++ b/project/build/Partest.scala @@ -29,24 +29,23 @@ class TestConfiguration(val library:Path, val classpath:Iterable[Path], val test trait PartestRunner{ self: BasicLayer with Packer => - import Partest.{runTest} + import Partest.runTest import TestSetType._ - - lazy val testRoot = projectRoot / "test" + lazy val testRoot = projectRoot / "test" lazy val testFiles = testRoot / "files" ## - lazy val testLibs = testFiles / "lib" + lazy val testLibs = testFiles / "lib" - lazy val posFilesTest = TestSet(Std,"pos", "Compiling files that are expected to build", testFiles / "pos" * ("*.scala" || DirectoryFilter)) - lazy val negFilesTest = TestSet(Std,"neg", "Compiling files that are expected to fail", testFiles / "neg" * ("*.scala" || DirectoryFilter)) - lazy val runFilesTest = TestSet(Std,"run", "Compiling and running files", testFiles / "run" ** ("*.scala" )) - lazy val jvmFilesTest = TestSet(Std,"jvm", "Compiling and running files", testFiles / "jvm" *("*.scala" || DirectoryFilter)) - lazy val resFilesTest = TestSet(Std,"res", "Running resident compiler scenarii", testFiles / "res" * ("*.res")) + lazy val posFilesTest = TestSet(Std,"pos", "Compiling files that are expected to build", testFiles / "pos" * ("*.scala" || DirectoryFilter)) + lazy val negFilesTest = TestSet(Std,"neg", "Compiling files that are expected to fail", testFiles / "neg" * ("*.scala" || DirectoryFilter)) + lazy val runFilesTest = TestSet(Std,"run", "Compiling and running files", testFiles / "run" ** ("*.scala" )) + lazy val jvmFilesTest = TestSet(Std,"jvm", "Compiling and running files", testFiles / "jvm" *("*.scala" || DirectoryFilter)) + lazy val resFilesTest = TestSet(Std,"res", "Running resident compiler scenarii", testFiles / "res" * ("*.res")) lazy val buildmanagerFilesTest = TestSet(Std,"buildmanager", "Running Build Manager scenarii", testFiles / "buildmanager" * DirectoryFilter) - lazy val scalacheckFilesTest = TestSet(Std,"scalacheck", "Running scalacheck tests", testFiles / "scalacheck" ** ("*.scala")) - lazy val scriptFilesTest = TestSet(Std,"script", "Running script files", testFiles / "script" * ("*.scala")) - lazy val shootoutFilesTest = TestSet(Std,"shootout", "Running shootout tests", testFiles / "shootout" * ("*.scala")) - lazy val scalapFilesTest = TestSet(Std,"scalap", "Running scalap tests", testFiles / "scalap" ** ("*.scala")) + lazy val scalacheckFilesTest = TestSet(Std,"scalacheck", "Running scalacheck tests", testFiles / "scalacheck" ** ("*.scala")) + lazy val scriptFilesTest = TestSet(Std,"script", "Running script files", testFiles / "script" * ("*.scala")) + lazy val shootoutFilesTest = TestSet(Std,"shootout", "Running shootout tests", testFiles / "shootout" * ("*.scala")) + lazy val scalapFilesTest = TestSet(Std,"scalap", "Running scalap tests", testFiles / "scalap" ** ("*.scala")) lazy val negContinuationTest = TestSet(Continuations,"neg", "Compiling continuations files that are expected to fail", testFiles / "continuations-neg" * ("*.scala" || DirectoryFilter)) lazy val runContinuationTest = TestSet(Continuations,"run", "Compiling and running continuations files", testFiles / "continuations-run" ** ("*.scala" )) @@ -63,7 +62,7 @@ trait PartestRunner{ private lazy val partestCompletionList = filesTestMap.keys.toList:::partestOptions:::filesTestMap.values.toList.flatMap{_.files.map(_.toString.substring(testFiles.asFile.toString.length+1))} - private def runPartest(tests:List[TestSet],scalacOpts:Option[String], failedOnly:Boolean) = { + private def runPartest(tests:List[TestSet],scalacOpts:Option[String], failedOnly:Boolean) = { val config = new TestConfiguration( outputLibraryJar, @@ -74,14 +73,23 @@ trait PartestRunner{ ) val javaHome = Path.fromFile(new File(System.getProperty("java.home"))) - val java = javaHome / "bin" / "java" - val javac = javaHome/"bin"/"javac" + val java = Some(javaHome / "bin" / "java" asFile) + val javac = Some(javaHome / "bin" / "javac" asFile) + val timeout = Some("2400000") + val loader = info.launcher.topLoader + val isDebug = info.logger atLevel Level.Debug + log.debug("Ready to run tests") - if (tests.isEmpty){ + + if (tests.isEmpty) { log.debug("Empty test list") None - }else - runTest(info.launcher.topLoader,config,Some(java.asFile),Some(javac.asFile),scalacOpts,Some("2400000"), true,true,failedOnly,true,false,log) + } + else runTest( + loader, config, java, javac, + scalacOpts, timeout, true, true, + failedOnly, true, isDebug, log + ) } lazy val externalPartest = task {args => task { @@ -107,7 +115,7 @@ trait PartestRunner{ - def resolveSets(l:List[String],rem:List[String],acc:List[TestSet]):(List[String],List[TestSet]) = { + def resolveSets(l:List[String],rem:List[String],acc:List[TestSet]): (List[String], List[TestSet]) = { def searchSet(arg:String):Option[TestSet] = { filesTestMap.get(arg) } @@ -202,7 +210,7 @@ object Partest { setMethod.invoke(fileManager, Array(value).asInstanceOf[Array[Object]]: _*) } - System.setProperty("partest.srcdir",config.testRoot.absolutePath) + // System.setProperty("partest.srcdir", "files") setFileManagerBooleanProperty("showDiff", showDiff) setFileManagerBooleanProperty("showLog", showLog) @@ -213,10 +221,8 @@ object Partest { setFileManagerStringProperty("JAVAC_CMD", "javac") setFileManagerStringProperty("CLASSPATH",(config.classpath.map(_.absolutePath).mkString(File.pathSeparator))) setFileManagerStringProperty("LATEST_LIB", config.library.absolutePath) - scalacOpts match { - case None => setFileManagerStringProperty("SCALAC_OPTS","") - case Some(options) => setFileManagerStringProperty("SCALAC_OPTS",options) - } + setFileManagerStringProperty("SCALAC_OPTS", scalacOpts getOrElse "") + if (!timeout.isEmpty) setFileManagerStringProperty("timeout", timeout.get) |