Skip to content

Commit 9d48aad

Browse files
committed
Add test for #2395
1 parent cd631a5 commit 9d48aad

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package dotty
2+
package tools
3+
package dotc
4+
5+
import org.junit.{ Test, AfterClass }
6+
7+
import vulpix.{ ParallelTesting, SummaryReport, SummaryReporting, TestConfiguration }
8+
9+
import scala.concurrent.duration._
10+
11+
class MissingCoreLibTests extends ParallelTesting {
12+
import MissingCoreLibTests._
13+
import TestConfiguration._
14+
15+
// Test suite configuration --------------------------------------------------
16+
17+
def maxDuration = 30.seconds
18+
def numberOfSlaves = 5
19+
def safeMode = Properties.testsSafeMode
20+
def isInteractive = SummaryReport.isInteractive
21+
def testFilter = Properties.testsFilter
22+
23+
@Test def missingDottyLib: Unit = {
24+
val classPath = mkClassPath(Jars.dottyCompiler :: Jars.dottyInterfaces :: Jars.dottyExtras) // missing Jars.dottyLib
25+
val options = noCheckOptions ++ checkOptions ++ yCheckOptions ++ classPath
26+
compileFile("../tests/neg/nolib/Foo.scala", options).checkExpectedErrors()
27+
}
28+
29+
}
30+
31+
object MissingCoreLibTests {
32+
implicit val summaryReport: SummaryReporting = new SummaryReport
33+
@AfterClass def cleanup(): Unit = summaryReport.echoSummary()
34+
}

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ object TestConfiguration {
2323
"-Yforce-sbt-phases"
2424
)
2525

26-
val classPath = {
27-
val paths = Jars.dottyTestDeps map { p =>
26+
val classPath = mkClassPath(Jars.dottyTestDeps)
27+
28+
def mkClassPath(deps: List[String]) = {
29+
val paths = deps map { p =>
2830
val file = new java.io.File(p)
2931
assert(
3032
file.exists,
@@ -50,7 +52,7 @@ object TestConfiguration {
5052
Array("-classpath", paths)
5153
}
5254

53-
private val yCheckOptions = Array("-Ycheck:tailrec,resolveSuper,erasure,mixin,getClass,restoreScopes,labelDef")
55+
val yCheckOptions = Array("-Ycheck:tailrec,resolveSuper,erasure,mixin,getClass,restoreScopes,labelDef")
5456

5557
val defaultUnoptimised = noCheckOptions ++ checkOptions ++ yCheckOptions ++ classPath
5658
val defaultOptimised = defaultUnoptimised :+ "-optimise"

tests/neg/nolib/Foo.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// nopos-error
2+
class Foo

0 commit comments

Comments
 (0)