summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2010-10-29 16:04:23 +0000
committerPhilipp Haller <hallerp@gmail.com>2010-10-29 16:04:23 +0000
commite73e777e21eb92da35b3fac827a565392b0589e0 (patch)
tree95803a2c42e2cc651e2f530a465e5c98a3c143dc /src
parenta2ce51bcb7f5681d81240e233cdf452f35a757db (diff)
downloadscala-e73e777e21eb92da35b3fac827a565392b0589e0.tar.gz
scala-e73e777e21eb92da35b3fac827a565392b0589e0.tar.bz2
scala-e73e777e21eb92da35b3fac827a565392b0589e0.zip
partest: fixed property handling of --debug.
Diffstat (limited to 'src')
-rw-r--r--src/partest/scala/tools/partest/nest/ConsoleRunner.scala4
-rw-r--r--src/partest/scala/tools/partest/nest/DirectRunner.scala14
-rw-r--r--src/partest/scala/tools/partest/package.scala6
3 files changed, 15 insertions, 9 deletions
diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
index 0890d12aeb..fe77621eee 100644
--- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
+++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
@@ -95,6 +95,8 @@ class ConsoleRunner extends DirectRunner {
if (parsed isSet "--timeout") fileManager.timeout = parsed("--timeout")
if (parsed isSet "--debug") setProp("partest.debug", "true")
+ setProperties() // must be done after processing command line arguments such as --debug
+
def addTestFile(file: File) = {
if (!file.exists)
NestUI.failure("Test file '%s' not found, skipping.\n" format file)
@@ -147,6 +149,8 @@ class ConsoleRunner extends DirectRunner {
""
) foreach (x => NestUI outline (x + "\n"))
+ NestUI.verbose("available processors: " + Runtime.getRuntime().availableProcessors())
+
val start = System.currentTimeMillis
val (successes, failures) = testCheckAll(enabledTestSets)
val end = System.currentTimeMillis
diff --git a/src/partest/scala/tools/partest/nest/DirectRunner.scala b/src/partest/scala/tools/partest/nest/DirectRunner.scala
index 40f397e86b..7410e890a0 100644
--- a/src/partest/scala/tools/partest/nest/DirectRunner.scala
+++ b/src/partest/scala/tools/partest/nest/DirectRunner.scala
@@ -18,22 +18,22 @@ import scala.tools.nsc.io.Directory
import scala.actors.Actor._
import scala.actors.TIMEOUT
-
case class TestRunParams(val scalaCheckParentClassLoader: ScalaClassLoader)
-
trait DirectRunner {
def fileManager: FileManager
import PartestDefaults.numActors
- if (isPartestDebug)
- scala.actors.Debug.level = 3
+ def setProperties() {
+ if (isPartestDebug)
+ scala.actors.Debug.level = 3
- if (PartestDefaults.poolSize.isEmpty) {
- scala.actors.Debug.info("actors.corePoolSize not defined")
- setProp("actors.corePoolSize", "16")
+ if (PartestDefaults.poolSize.isEmpty) {
+ scala.actors.Debug.info("actors.corePoolSize not defined")
+ setProp("actors.corePoolSize", "16")
+ }
}
def runTestsForFiles(kindFiles: List[File], kind: String): scala.collection.immutable.Map[String, Int] = {
diff --git a/src/partest/scala/tools/partest/package.scala b/src/partest/scala/tools/partest/package.scala
index e9eda6fb75..3d66d38b6d 100644
--- a/src/partest/scala/tools/partest/package.scala
+++ b/src/partest/scala/tools/partest/package.scala
@@ -16,6 +16,7 @@ package object partest {
implicit private[partest] def temporaryFile2Path(x: JFile): Path = Path(x)
def basename(name: String): String = Path(name).stripExtension
+
def resultsToStatistics(results: Iterable[(_, Int)]): (Int, Int) = {
val (files, failures) = results map (_._2 == 0) partition (_ == true)
(files.size, failures.size)
@@ -36,5 +37,6 @@ package object partest {
NestUI.verbose(allPropertiesString)
}
- def isPartestDebug = propOrEmpty("partest.debug") == "true"
-} \ No newline at end of file
+ def isPartestDebug: Boolean =
+ propOrEmpty("partest.debug") == "true"
+}