diff options
author | Micro Dotta <mirco.dotta@gmail.com> | 2011-10-09 20:55:55 +0000 |
---|---|---|
committer | Micro Dotta <mirco.dotta@gmail.com> | 2011-10-09 20:55:55 +0000 |
commit | 1706358bdcf0492b82e87c8f34e9b7120348df8b (patch) | |
tree | 1e3a97b334dbd8513b614ee82b2444430bebf083 | |
parent | bc4468cdd266fc12fe164c1b6ec4da94b71a4129 (diff) | |
download | scala-1706358bdcf0492b82e87c8f34e9b7120348df8b.tar.gz scala-1706358bdcf0492b82e87c8f34e9b7120348df8b.tar.bz2 scala-1706358bdcf0492b82e87c8f34e9b7120348df8b.zip |
Minor update of the PC's testing framework.
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala | 13 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala | 13 |
2 files changed, 19 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala b/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala index 3bad2d0962..7be115e777 100644 --- a/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala +++ b/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala @@ -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) } }
\ No newline at end of file diff --git a/src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala b/src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala index b65d069d94..35d6723818 100644 --- a/src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala +++ b/src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala @@ -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, _) + } + } + +} |