summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2010-01-24 22:57:30 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2010-01-24 22:57:30 +0000
commite4e513079f2662758a0737a2a9a28abbcf1c9f7e (patch)
treebab62ecec0ba2bc9f0cbc76ca8d5af0deea28a8d /src/compiler
parent7140e9c3ad9c60a0a55aee63ecd20940534375d4 (diff)
downloadscala-e4e513079f2662758a0737a2a9a28abbcf1c9f7e.tar.gz
scala-e4e513079f2662758a0737a2a9a28abbcf1c9f7e.tar.bz2
scala-e4e513079f2662758a0737a2a9a28abbcf1c9f7e.zip
Added new target for partest for testing Build ...
Added new target for partest for testing Build Manager behaviour. Updated Refined Build Manager for consistency. --buildmanager requires the test file that describes actions to be done on the refined build manager (compiling files, making changes to the classes), sources of changes, the check file and the initial scala source files. Cleaned up some code in partest, refactored some obvious code duplication. Tests to follow... Review by phaller.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala2
-rw-r--r--src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 3cde4698ff..08671526e6 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -130,7 +130,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
import util.NoPosition
def error(msg: String) = reporter.error(NoPosition, msg)
def warning(msg: String) = reporter.warning(NoPosition, msg)
- def inform(msg: String) = Console.err.println(msg)
+ def inform(msg: String) = reporter.info(NoPosition, msg, true)
def inform[T](msg: String, value: T): T = { inform(msg+value); value }
//reporter.info(null, msg, true)
diff --git a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
index 5e1729a515..7268c6c8c7 100644
--- a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
@@ -102,6 +102,7 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
private def update(files: Set[AbstractFile]) = {
val coll: mutable.Map[AbstractFile, immutable.Set[AbstractFile]] =
mutable.HashMap[AbstractFile, immutable.Set[AbstractFile]]()
+ compiler.reporter.reset
// See if we really have coresponding symbols, not just those
// which share the name
@@ -117,7 +118,6 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
run.compileFiles(files.toList)
if (compiler.reporter.hasErrors) {
- compiler.reporter.reset
return
}
@@ -158,7 +158,7 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
}
}
}
- println("Changes: " + changesOf)
+ compiler.inform("Changes: " + changesOf)
updateDefinitions(files)
val invalid = invalidated(files, changesOf, additionalDefs)
update0(checkCycles(invalid, files, coll))
@@ -206,7 +206,7 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
compiler.dependencyAnalysis.dependencies.dependentFiles(1, files)
def invalidate(file: AbstractFile, reason: String, change: Change) = {
- println("invalidate " + file + " because " + reason + " [" + change + "]")
+ compiler.inform("invalidate " + file + " because " + reason + " [" + change + "]")
buf += file
directDeps -= file
for (syms <- definitions(file)) // fixes #2557
@@ -217,7 +217,7 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
for ((oldSym, changes) <- changesOf; change <- changes) {
def checkParents(cls: Symbol, file: AbstractFile) {
val parentChange = cls.info.parents.exists(_.typeSymbol.fullNameString == oldSym.fullNameString)
- // println("checkParents " + cls + " oldSym: " + oldSym + " parentChange: " + parentChange + " " + cls.info.parents)
+ // compiler.inform("checkParents " + cls + " oldSym: " + oldSym + " parentChange: " + parentChange + " " + cls.info.parents)
change match {
case Changed(Class(_)) if parentChange =>
invalidate(file, "parents have changed", change)
@@ -249,7 +249,7 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
}
def checkReferences(file: AbstractFile) {
- // println(file + ":" + references(file))
+ // compiler.inform(file + ":" + references(file))
val refs = references(file)
if (refs.isEmpty)
invalidate(file, "it is a direct dependency and we don't yet have finer-grained dependency information", change)