From cad618eb39b2830ace419df4c0c7b2f325f270f7 Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Fri, 20 Oct 2017 16:01:30 +0200 Subject: [PATCH] Make MissingCoreLibTests a simple unit test --- .../tools/dotc/MissingCoreLibTests.scala | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/compiler/test/dotty/tools/dotc/MissingCoreLibTests.scala b/compiler/test/dotty/tools/dotc/MissingCoreLibTests.scala index 9490abecdf94..31c7197ad498 100644 --- a/compiler/test/dotty/tools/dotc/MissingCoreLibTests.scala +++ b/compiler/test/dotty/tools/dotc/MissingCoreLibTests.scala @@ -2,32 +2,21 @@ package dotty package tools package dotc -import org.junit.{AfterClass, Test} -import vulpix._ +import org.junit.Test +import org.junit.Assert._ -import scala.concurrent.duration._ +import vulpix.TestConfiguration.mkClassPath -class MissingCoreLibTests extends ParallelTesting { - import MissingCoreLibTests._ - import TestConfiguration._ - - // Test suite configuration -------------------------------------------------- - - def maxDuration = 30.seconds - def numberOfSlaves = 5 - def safeMode = Properties.testsSafeMode - def isInteractive = SummaryReport.isInteractive - def testFilter = Properties.testsFilter +class MissingCoreLibTests { @Test def missingDottyLib: Unit = { val classPath = mkClassPath(Jars.dottyCompiler :: Jars.dottyInterfaces :: Jars.dottyExtras) // missing Jars.dottyLib - val options = noCheckOptions ++ checkOptions ++ yCheckOptions - compileFile("../tests/neg/nolib/Foo.scala", TestFlags(classPath, options)).checkExpectedErrors() + val source = "../tests/neg/nolib/Foo.scala" + val options = Array("-classpath", classPath, source) + val reporter = Main.process(options) + assertEquals(1, reporter.errorCount) + val errorMessage = reporter.allErrors.head.message + assertTrue(errorMessage.contains("Make sure the compiler core libraries are on the classpath")) } } - -object MissingCoreLibTests { - implicit val summaryReport: SummaryReporting = new SummaryReport - @AfterClass def cleanup(): Unit = summaryReport.echoSummary() -}