Skip to content

Commit 0c4a80c

Browse files
committed
Reproduce crash in scala#7990
1 parent f681d2b commit 0c4a80c

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class CompilationTests extends ParallelTesting {
6262
compileFile("tests/pos-special/notNull.scala", defaultOptions.and("-Yexplicit-nulls")),
6363
compileDir("tests/pos-special/adhoc-extension", defaultOptions.and("-strict", "-feature", "-Xfatal-warnings")),
6464
compileFile("tests/pos-special/i7575.scala", defaultOptions.and("-language:dynamics")),
65+
66+
withLibs("junit:junit:4.13") { flags => compileFile("tests/pos-custom-args/i7990.scala", flags) }
6567
).checkCompile()
6668
}
6769

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,25 @@ object TestConfiguration {
7070

7171
/** Enables explicit nulls */
7272
val explicitNullsOptions = defaultOptions and "-Yexplicit-nulls"
73+
74+
def withLibs[T](depsRaw: String*)(fn: TestFlags => T): T = {
75+
import coursier._
76+
import coursier.parse._
77+
78+
val deps = depsRaw.map { dep =>
79+
DependencyParser.dependency(dep, "2.13") match {
80+
case Right(dep) => dep
81+
case Left(msg) => throw new Exception(msg)
82+
}
83+
}
84+
val jars = Fetch()
85+
.addDependencies(deps:_*)
86+
.run()
87+
.map(_.toString)
88+
.toList
89+
90+
val path = mkClasspath(jars)
91+
val flags = defaultOptions.withClasspath(path).withRunClasspath(path)
92+
fn(flags)
93+
}
7394
}

project/Build.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ object Build {
238238
scalaModuleInfo ~= (_.map(_.withOverrideScalaVersion(false))),
239239

240240
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test,
241+
libraryDependencies += "io.get-coursier" % "coursier_2.13" % "2.0.0-RC5-6" % Test,
242+
// libraryDependencies += "io.get-coursier" % "coursier-cache_2.13" % "2.0.0-RC5-6" % Test,
241243

242244
// If someone puts a source file at the root (e.g., for manual testing),
243245
// don't pick it up as part of any project.

tests/pos-custom-args/i7990.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@main def main = org.junit.AssumptionViolatedException("error")

0 commit comments

Comments
 (0)