diff options
Diffstat (limited to 'test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala')
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala index 57088bdd2f..5cb1aab4a9 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala @@ -16,22 +16,21 @@ import scala.tools.testing.ClearAfterClass import BackendReporting._ -import scala.collection.convert.decorateAsScala._ +import scala.collection.JavaConverters._ -object InlineInfoTest extends ClearAfterClass.Clearable { - var compiler = newCompiler(extraArgs = "-Ybackend:GenBCode -Yopt:l:classpath") - def clear(): Unit = { compiler = null } +@RunWith(classOf[JUnit4]) +class InlineInfoTest extends ClearAfterClass { + val compiler = cached("compiler", () => newCompiler(extraArgs = "-Yopt:l:classpath")) - def notPerRun: List[Clearable] = List(compiler.genBCode.bTypes.classBTypeFromInternalName, compiler.genBCode.bTypes.byteCodeRepository.classes) + import compiler.genBCode.bTypes + def notPerRun: List[Clearable] = List( + bTypes.classBTypeFromInternalName, + bTypes.byteCodeRepository.compilingClasses, + bTypes.byteCodeRepository.parsedClasses) notPerRun foreach compiler.perRunCaches.unrecordCache -} - -@RunWith(classOf[JUnit4]) -class InlineInfoTest { - val compiler = InlineInfoTest.compiler def compile(code: String) = { - InlineInfoTest.notPerRun.foreach(_.clear()) + notPerRun.foreach(_.clear()) compileClasses(compiler)(code) } @@ -55,6 +54,7 @@ class InlineInfoTest { |class C extends T with U """.stripMargin val classes = compile(code) + val fromSyms = classes.map(c => compiler.genBCode.bTypes.classBTypeFromInternalName(c.name).info.get.inlineInfo) val fromAttrs = classes.map(c => { |