diff options
author | Philipp Haller <hallerp@gmail.com> | 2008-12-18 20:35:24 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2008-12-18 20:35:24 +0000 |
commit | 05a663c12f35d15c181d3494ddbc7b6ab86bcc41 (patch) | |
tree | 3ae977996eb86f47678af6b240db703808edebc9 /src/partest | |
parent | c3cfea47e0f8674931ea19c35c11cfefcf7c81e9 (diff) | |
download | scala-05a663c12f35d15c181d3494ddbc7b6ab86bcc41.tar.gz scala-05a663c12f35d15c181d3494ddbc7b6ab86bcc41.tar.bz2 scala-05a663c12f35d15c181d3494ddbc7b6ab86bcc41.zip |
Add debug option to partest ant task.
Diffstat (limited to 'src/partest')
-rw-r--r-- | src/partest/scala/tools/partest/PartestTask.scala | 6 | ||||
-rw-r--r-- | src/partest/scala/tools/partest/nest/DirectRunner.scala | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala index 56e52f96d4..bdc7f06893 100644 --- a/src/partest/scala/tools/partest/PartestTask.scala +++ b/src/partest/scala/tools/partest/PartestTask.scala @@ -79,6 +79,9 @@ class PartestTask extends Task { def setTimeout(delay: String): Unit = timeout = Some(delay) + def setDebug(input: Boolean): Unit = + debug = input + private var classpath: Option[Path] = None private var javacmd: Option[File] = None private var javaccmd: Option[File] = None @@ -96,6 +99,7 @@ class PartestTask extends Task { private var errorOnFailed: Boolean = false private var scalacOpts: Option[String] = None private var timeout: Option[String] = None + private var debug = false private def getFilesAndDirs(fileSet: Option[FileSet]): Array[File] = if (!fileSet.isEmpty) { @@ -164,6 +168,8 @@ class PartestTask extends Task { Array() override def execute(): Unit = { + if (debug) + System.setProperty("partest.debug", "true") if (classpath.isEmpty) error("Mandatory attribute 'classpath' is not set.") diff --git a/src/partest/scala/tools/partest/nest/DirectRunner.scala b/src/partest/scala/tools/partest/nest/DirectRunner.scala index 598fdf0e17..af3d7bcd8a 100644 --- a/src/partest/scala/tools/partest/nest/DirectRunner.scala +++ b/src/partest/scala/tools/partest/nest/DirectRunner.scala @@ -19,6 +19,21 @@ trait DirectRunner { private val numActors = Integer.parseInt(System.getProperty("scalatest.actors", "8")) + if ((System.getProperty("partest.debug", "false") equals "true") || + (System.getProperty("scalatest.debug", "false") equals "true")) + scala.actors.Debug.level = 3 + + private val coreProp = try { + System.getProperty("actors.corePoolSize") + } catch { + case ace: java.security.AccessControlException => + null + } + if (coreProp == null) { + scala.actors.Debug.info("actors.corePoolSize not defined") + System.setProperty("actors.corePoolSize", "16") + } + def runTestsForFiles(kindFiles: List[File], kind: String): (Int, Int) = { val len = kindFiles.length val (testsEach, lastFrag) = (len/numActors, len%numActors) |