From b6757e11a1970480a60741235fc86f01d8957e07 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 19 May 2013 09:43:04 -0700 Subject: An attempt to make tests deterministic. The nondeterminism presently showing itself in presentation/implicit-member is a consequence of the presentation compiler tests relying on details of the behavior of toString calls. We need to stomp this out, but it will take a while. Based on the check file changes enclosed with this commit, this will suffice for the presentation compiler tests. A broader assault will have to take place, but not yet. --- src/interactive/scala/tools/nsc/interactive/CompilerControl.scala | 5 +++++ .../scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala b/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala index c38c7c8257..d036a6e853 100644 --- a/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala +++ b/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala @@ -297,6 +297,11 @@ trait CompilerControl { self: Global => def implicitlyAdded = false private def accessible_s = if (accessible) "" else "[inaccessible] " + def forceInfoString = { + definitions.fullyInitializeSymbol(sym) + definitions.fullyInitializeType(tpe) + infoString + } def infoString = s"$accessible_s${sym.defStringSeenAs(tpe)}" } diff --git a/src/interactive/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala b/src/interactive/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala index 08d84af8f5..e28bf20745 100644 --- a/src/interactive/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala +++ b/src/interactive/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala @@ -27,7 +27,7 @@ private[tests] trait CoreTestDefs reporter.println("retrieved %d members".format(members.size)) compiler ask { () => val filtered = members.filterNot(member => (member.sym.name string_== "getClass") || member.sym.isConstructor) - reporter println (filtered.map(_.infoString).sorted mkString "\n") + reporter println (filtered.map(_.forceInfoString).sorted mkString "\n") } } } -- cgit v1.2.3