Skip to content

Commit cad618e

Browse files
committed
Make MissingCoreLibTests a simple unit test
1 parent 174444d commit cad618e

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

compiler/test/dotty/tools/dotc/MissingCoreLibTests.scala

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,21 @@ package dotty
22
package tools
33
package dotc
44

5-
import org.junit.{AfterClass, Test}
6-
import vulpix._
5+
import org.junit.Test
6+
import org.junit.Assert._
77

8-
import scala.concurrent.duration._
8+
import vulpix.TestConfiguration.mkClassPath
99

10-
class MissingCoreLibTests extends ParallelTesting {
11-
import MissingCoreLibTests._
12-
import TestConfiguration._
13-
14-
// Test suite configuration --------------------------------------------------
15-
16-
def maxDuration = 30.seconds
17-
def numberOfSlaves = 5
18-
def safeMode = Properties.testsSafeMode
19-
def isInteractive = SummaryReport.isInteractive
20-
def testFilter = Properties.testsFilter
10+
class MissingCoreLibTests {
2111

2212
@Test def missingDottyLib: Unit = {
2313
val classPath = mkClassPath(Jars.dottyCompiler :: Jars.dottyInterfaces :: Jars.dottyExtras) // missing Jars.dottyLib
24-
val options = noCheckOptions ++ checkOptions ++ yCheckOptions
25-
compileFile("../tests/neg/nolib/Foo.scala", TestFlags(classPath, options)).checkExpectedErrors()
14+
val source = "../tests/neg/nolib/Foo.scala"
15+
val options = Array("-classpath", classPath, source)
16+
val reporter = Main.process(options)
17+
assertEquals(1, reporter.errorCount)
18+
val errorMessage = reporter.allErrors.head.message
19+
assertTrue(errorMessage.contains("Make sure the compiler core libraries are on the classpath"))
2620
}
2721

2822
}
29-
30-
object MissingCoreLibTests {
31-
implicit val summaryReport: SummaryReporting = new SummaryReport
32-
@AfterClass def cleanup(): Unit = summaryReport.echoSummary()
33-
}

0 commit comments

Comments
 (0)