Minor update of the PC's testing framework. Specifically, loosed access modifiers of a few methods so that they can be accessed by the test runner definition. no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25810 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
Mirco 2011-10-09 20:55:55 +00:00
parent 0a2098a2ad
commit 4f98dc4b6b
2 changed files with 19 additions and 7 deletions

View File

@ -54,6 +54,7 @@ abstract class InteractiveTest
extends AskParse
with AskShutdown
with AskReload
with AskLoadedTyped
with PresentationCompilerInstance
with CoreTestDefs
with InteractiveTestSettings { self =>
@ -83,11 +84,6 @@ abstract class InteractiveTest
loadSources()
runTests()
shutdown()
// this is actually needed to force exit on test completion.
// Note: May be a bug on either the testing framework or (less likely)
// the presentation compiler
sys.exit(0)
}
/** Load all sources before executing the test. */
@ -118,7 +114,12 @@ abstract class InteractiveTest
}
/** shutdown the presentation compiler. */
private def shutdown() {
protected def shutdown() {
askShutdown()
// this is actually needed to force exit on test completion.
// Note: May be a bug on either the testing framework or (less likely)
// the presentation compiler
sys.exit(0)
}
}

View File

@ -61,7 +61,7 @@ trait AskParse extends AskCommand {
trait AskReload extends AskCommand {
/** Reload the given source files and wait for them to be reloaded. */
private[tests] def askReload(sources: Seq[SourceFile])(implicit reporter: Reporter): Response[Unit] = {
protected def askReload(sources: Seq[SourceFile])(implicit reporter: Reporter): Response[Unit] = {
val sortedSources = (sources map (_.file.name)).sorted
reporter.println("reload: " + sortedSources.mkString(", "))
@ -113,3 +113,14 @@ trait AskType extends AskCommand {
}
}
trait AskLoadedTyped extends AskCommand {
import compiler.Tree
protected def askLoadedTyped(source: SourceFile)(implicit reporter: Reporter): Response[Tree] = {
ask {
compiler.askLoadedTyped(source, _)
}
}
}