summaryrefslogtreecommitdiff
path: root/src/interactive/scala/tools
diff options
context:
space:
mode:
authorEugene Vigdorchik <eugene.vigdorchik@gmail.com>2013-03-26 10:46:58 +0400
committerEugene Vigdorchik <eugene.vigdorchik@gmail.com>2013-03-26 14:38:43 +0400
commit74de4ba0a295db8754d0aee12c01d51af0d12d8b (patch)
treec82662b2fdfee0d697760ccffcda5877ede2d4c1 /src/interactive/scala/tools
parent59d4998cf4a19eb5d44118d4867c2370e9a935e5 (diff)
downloadscala-74de4ba0a295db8754d0aee12c01d51af0d12d8b.tar.gz
scala-74de4ba0a295db8754d0aee12c01d51af0d12d8b.tar.bz2
scala-74de4ba0a295db8754d0aee12c01d51af0d12d8b.zip
Improve testing interactive experience.
Currently the exceptions that happen in the test are swallowed, as the JVM is forced to exit before printing the stack trace. Also assert message doesn't contain information about the problem. The call to "sys.exit" masks bugs in the testing framework, that has to be addressed more elaborately, so here we remove it. Also add the message parameter to assert to make it more informative. After removing "sys.exit" call, doc test starts failing. I suspect there might be a problem when expanding doc variables, but this should be addressed separately.
Diffstat (limited to 'src/interactive/scala/tools')
-rw-r--r--src/interactive/scala/tools/nsc/interactive/tests/InteractiveTest.scala12
-rw-r--r--src/interactive/scala/tools/nsc/interactive/tests/core/SourcesCollector.scala2
2 files changed, 2 insertions, 12 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/tests/InteractiveTest.scala b/src/interactive/scala/tools/nsc/interactive/tests/InteractiveTest.scala
index a4a2de9b51..f30d896fb7 100644
--- a/src/interactive/scala/tools/nsc/interactive/tests/InteractiveTest.scala
+++ b/src/interactive/scala/tools/nsc/interactive/tests/InteractiveTest.scala
@@ -74,7 +74,7 @@ abstract class InteractiveTest
/** Test's entry point */
def main(args: Array[String]) {
try execute()
- finally shutdown()
+ finally askShutdown()
}
protected def execute(): Unit = {
@@ -110,14 +110,4 @@ abstract class InteractiveTest
tester.run()
}
****/
-
- /** shutdown the presentation compiler. */
- 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)
- }
}
diff --git a/src/interactive/scala/tools/nsc/interactive/tests/core/SourcesCollector.scala b/src/interactive/scala/tools/nsc/interactive/tests/core/SourcesCollector.scala
index 676feeba8a..40cfc111a1 100644
--- a/src/interactive/scala/tools/nsc/interactive/tests/core/SourcesCollector.scala
+++ b/src/interactive/scala/tools/nsc/interactive/tests/core/SourcesCollector.scala
@@ -11,7 +11,7 @@ private[tests] object SourcesCollector {
* With the default `filter` only .scala and .java files are collected.
* */
def apply(base: Path, filter: SourceFilter): Array[SourceFile] = {
- assert(base.isDirectory)
+ assert(base.isDirectory, base + " is not a directory")
base.walk.filter(filter).map(source).toList.toArray.sortBy(_.file.name)
}