Skip to content

Commit ca46548

Browse files
committed
Check if run tests are working on the CI.
1 parent 2ae902b commit ca46548

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class CompilationTests {
2626
import CompilationTests._
2727
import CompilationTest.aggregateTests
2828

29+
def `isJava16+`: Boolean = scala.util.Properties.isJavaAtLeast("16")
30+
2931
// Positive tests ------------------------------------------------------------
3032

3133
@Test def pos: Unit = {
@@ -50,7 +52,7 @@ class CompilationTests {
5052
else Nil
5153
)
5254

53-
if scala.util.Properties.isJavaAtLeast("16") then
55+
if `isJava16+` then
5456
tests ::= compileFilesInDir("tests/pos-java16+", defaultOptions.and("-Ysafe-init"))
5557

5658
aggregateTests(tests*).checkCompile()
@@ -155,13 +157,18 @@ class CompilationTests {
155157

156158
@Test def runAll: Unit = {
157159
implicit val testGroup: TestGroup = TestGroup("runAll")
158-
aggregateTests(
160+
var tests = List(
159161
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init")),
160162
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
161163
compileFilesInDir("tests/run-custom-args/captures", allowDeepSubtypes.and("-language:experimental.captureChecking")),
162164
// Run tests for legacy lazy vals.
163165
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init", "-Ylegacy-lazy-vals", "-Ycheck-constraint-deps"), FileFilter.include(TestSources.runLazyValsAllowlist)),
164-
).checkRuns()
166+
)
167+
168+
if `isJava16+` then
169+
tests ::= compileFilesInDir("tests/run-java16+", defaultOptions.and("-Ysafe-init"))
170+
171+
aggregateTests(tests*).checkRuns()
165172
}
166173

167174
// Generic java signatures tests ---------------------------------------------
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public record R1(int i) {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// scalajs: --skip
2+
3+
object Test {
4+
def main(args: Array[String]): Unit = {
5+
val r1 = R1(42)
6+
r1 match {
7+
case R1(i) => assert(i == 42)
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)