@@ -30,22 +30,16 @@ class CompilationTests {
30
30
@ Test def pos : Unit = {
31
31
implicit val testGroup : TestGroup = TestGroup (" compilePos" )
32
32
var tests = List (
33
- compileFile(" tests/pos/nullarify.scala" , defaultOptions.and(" -Ycheck:nullarify" )),
34
- compileFile(" tests/pos-special/utf8encoded.scala" , explicitUTF8),
35
- compileFile(" tests/pos-special/utf16encoded.scala" , explicitUTF16),
33
+ compileFilesInDir(" tests/pos" , defaultOptions.and(" -Ysafe-init" )),
34
+ compileFilesInDir(" tests/pos-deep-subtype" , allowDeepSubtypes),
36
35
compileFilesInDir(" tests/pos-special/sourcepath/outer" , defaultOptions.and(" -sourcepath" , " tests/pos-special/sourcepath" )),
37
36
compileFile(" tests/pos-special/sourcepath/outer/nested/Test4.scala" , defaultOptions.and(" -sourcepath" , " tests/pos-special/sourcepath" )),
38
- compileFilesInDir(" tests/pos-special/fatal-warnings" , defaultOptions.and(" -Xfatal-warnings" , " -deprecation" , " -feature" )),
39
- compileFilesInDir(" tests/pos-special/spec-t5545" , defaultOptions),
40
- compileFilesInDir(" tests/pos-special/strawman-collections" , allowDeepSubtypes),
41
- compileFilesInDir(" tests/pos-special/isInstanceOf" , allowDeepSubtypes.and(" -Xfatal-warnings" )),
42
- compileFilesInDir(" tests/new" , defaultOptions.and(" -source" , " 3.2" )), // just to see whether 3.2 works
43
- compileFilesInDir(" tests/pos-scala2" , scala2CompatMode),
37
+ compileFilesInDir(" tests/pos-scala2" , defaultOptions.and(" -source" , " 3.0-migration" )),
44
38
compileFilesInDir(" tests/pos-custom-args/captures" , defaultOptions.and(" -language:experimental.captureChecking" )),
45
- compileFilesInDir(" tests/pos" , defaultOptions.and(" -Ysafe-init" )),
39
+ compileFile(" tests/pos-special/utf8encoded.scala" , defaultOptions.and(" -encoding" , " UTF8" )),
40
+ compileFile(" tests/pos-special/utf16encoded.scala" , defaultOptions.and(" -encoding" , " UTF16" )),
46
41
// Run tests for legacy lazy vals
47
42
compileFilesInDir(" tests/pos" , defaultOptions.and(" -Ysafe-init" , " -Ylegacy-lazy-vals" , " -Ycheck-constraint-deps" ), FileFilter .include(TestSources .posLazyValsAllowlist)),
48
- compileFilesInDir(" tests/pos-deep-subtype" , allowDeepSubtypes),
49
43
compileDir(" tests/pos-special/java-param-names" , defaultOptions.withJavacOnlyOptions(" -parameters" )),
50
44
)
51
45
@@ -59,7 +53,7 @@ class CompilationTests {
59
53
implicit val testGroup : TestGroup = TestGroup (" rewrites" )
60
54
61
55
aggregateTests(
62
- compileFile(" tests/rewrites/rewrites.scala" , scala2CompatMode .and(" -rewrite" , " -indent" )),
56
+ compileFile(" tests/rewrites/rewrites.scala" , defaultOptions.and( " -source " , " 3.0-migration " ) .and(" -rewrite" , " -indent" )),
63
57
compileFile(" tests/rewrites/rewrites3x.scala" , defaultOptions.and(" -rewrite" , " -source" , " future-migration" )),
64
58
compileFile(" tests/rewrites/rewrites3x.scala" , defaultOptions.and(" -rewrite" , " -source" , " future-migration" , " -Xfatal-warnings" )),
65
59
compileFile(" tests/rewrites/filtering-fors.scala" , defaultOptions.and(" -rewrite" , " -source" , " 3.2-migration" )),
@@ -120,27 +114,14 @@ class CompilationTests {
120
114
implicit val testGroup : TestGroup = TestGroup (" compileNeg" )
121
115
aggregateTests(
122
116
compileFilesInDir(" tests/neg" , defaultOptions),
123
- compileFilesInDir(" tests/neg-tailcall" , defaultOptions),
124
- compileFilesInDir(" tests/neg-strict" , defaultOptions.and(" -source" , " future" , " -deprecation" , " -Xfatal-warnings" )),
125
- compileFilesInDir(" tests/neg-custom-args/allow-double-bindings" , allowDoubleBindings),
126
- compileFilesInDir(" tests/neg-custom-args/allow-deep-subtypes" , allowDeepSubtypes),
117
+ compileFilesInDir(" tests/neg-deep-subtype" , allowDeepSubtypes),
127
118
compileFilesInDir(" tests/neg-custom-args/captures" , defaultOptions.and(" -language:experimental.captureChecking" )),
128
- compileFile(" tests/neg-custom-args/i1650.scala" , allowDeepSubtypes),
129
- compileFile(" tests/neg-custom-args/i3882.scala" , allowDeepSubtypes),
130
- compileFile(" tests/neg-custom-args/i4372.scala" , allowDeepSubtypes),
131
- compileFile(" tests/neg-custom-args/i1754.scala" , allowDeepSubtypes),
132
- compileFile(" tests/neg-custom-args/i12650.scala" , allowDeepSubtypes),
133
- compileFile(" tests/neg-custom-args/interop-polytypes.scala" , allowDeepSubtypes.and(" -Yexplicit-nulls" )),
134
- compileFile(" tests/neg-custom-args/conditionalWarnings.scala" , allowDeepSubtypes.and(" -deprecation" ).and(" -Xfatal-warnings" )),
135
- compileFilesInDir(" tests/neg-custom-args/isInstanceOf" , allowDeepSubtypes and " -Xfatal-warnings" ),
136
- compileFile(" tests/neg-custom-args/i3627.scala" , allowDeepSubtypes),
137
119
compileFile(" tests/neg-custom-args/sourcepath/outer/nested/Test1.scala" , defaultOptions.and(" -sourcepath" , " tests/neg-custom-args/sourcepath" )),
138
120
compileDir(" tests/neg-custom-args/sourcepath2/hi" , defaultOptions.and(" -sourcepath" , " tests/neg-custom-args/sourcepath2" , " -Xfatal-warnings" )),
139
121
compileList(" duplicate source" , List (
140
122
" tests/neg-custom-args/toplevel-samesource/S.scala" ,
141
123
" tests/neg-custom-args/toplevel-samesource/nested/S.scala" ),
142
124
defaultOptions),
143
- compileFile(" tests/neg-custom-args/i6300.scala" , allowDeepSubtypes),
144
125
compileFile(" tests/neg/i7575.scala" , defaultOptions.withoutLanguageFeatures.and(" -language:_" )),
145
126
).checkExpectedErrors()
146
127
}
@@ -155,12 +136,9 @@ class CompilationTests {
155
136
@ Test def runAll : Unit = {
156
137
implicit val testGroup : TestGroup = TestGroup (" runAll" )
157
138
aggregateTests(
158
- compileFile(" tests/run-custom-args/typeclass-derivation1.scala" , defaultOptions.without(yCheckOptions* )),
159
- compileFile(" tests/run-custom-args/tuple-cons.scala" , allowDeepSubtypes),
160
- compileFile(" tests/run-custom-args/i5256.scala" , allowDeepSubtypes),
161
- compileFilesInDir(" tests/run-custom-args/captures" , allowDeepSubtypes.and(" -language:experimental.captureChecking" )),
162
- compileFilesInDir(" tests/run-deep-subtype" , allowDeepSubtypes),
163
139
compileFilesInDir(" tests/run" , defaultOptions.and(" -Ysafe-init" )),
140
+ compileFilesInDir(" tests/run-deep-subtype" , allowDeepSubtypes),
141
+ compileFilesInDir(" tests/run-custom-args/captures" , allowDeepSubtypes.and(" -language:experimental.captureChecking" )),
164
142
// Run tests for legacy lazy vals.
165
143
compileFilesInDir(" tests/run" , defaultOptions.and(" -Ysafe-init" , " -Ylegacy-lazy-vals" , " -Ycheck-constraint-deps" ), FileFilter .include(TestSources .runLazyValsAllowlist)),
166
144
).checkRuns()
@@ -178,7 +156,6 @@ class CompilationTests {
178
156
@ Test def pickling : Unit = {
179
157
implicit val testGroup : TestGroup = TestGroup (" testPickling" )
180
158
aggregateTests(
181
- compileFilesInDir(" tests/new" , picklingOptions),
182
159
compileFilesInDir(" tests/pos" , picklingOptions, FileFilter .exclude(TestSources .posTestPicklingBlacklisted)),
183
160
compileFilesInDir(" tests/run" , picklingOptions, FileFilter .exclude(TestSources .runTestPicklingBlacklisted))
184
161
).checkCompile()
@@ -188,8 +165,7 @@ class CompilationTests {
188
165
def recheck : Unit =
189
166
given TestGroup = TestGroup (" recheck" )
190
167
aggregateTests(
191
- compileFilesInDir(" tests/new" , recheckOptions),
192
- compileFilesInDir(" tests/run" , recheckOptions, FileFilter .exclude(TestSources .runTestRecheckExcluded))
168
+ compileFilesInDir(" tests/run" , defaultOptions.and(" -Yrecheck-test" ), FileFilter .exclude(TestSources .runTestRecheckExcluded))
193
169
// Disabled to save some time.
194
170
// compileFilesInDir("tests/pos", recheckOptions, FileFilter.exclude(TestSources.posTestRecheckExcluded)),
195
171
).checkCompile()
@@ -198,22 +174,22 @@ class CompilationTests {
198
174
@ Test def explicitNullsNeg : Unit = {
199
175
implicit val testGroup : TestGroup = TestGroup (" explicitNullsNeg" )
200
176
aggregateTests(
201
- compileFilesInDir(" tests/explicit-nulls/neg" , explicitNullsOptions ),
202
- compileFilesInDir(" tests/explicit-nulls/unsafe-common" , explicitNullsOptions ),
177
+ compileFilesInDir(" tests/explicit-nulls/neg" , defaultOptions and " -Yexplicit-nulls " ),
178
+ compileFilesInDir(" tests/explicit-nulls/unsafe-common" , defaultOptions and " -Yexplicit-nulls " ),
203
179
)
204
180
}.checkExpectedErrors()
205
181
206
182
@ Test def explicitNullsPos : Unit = {
207
183
implicit val testGroup : TestGroup = TestGroup (" explicitNullsPos" )
208
184
aggregateTests(
209
- compileFilesInDir(" tests/explicit-nulls/pos" , explicitNullsOptions ),
210
- compileFilesInDir(" tests/explicit-nulls/unsafe-common" , explicitNullsOptions and " -language:unsafeNulls" ),
185
+ compileFilesInDir(" tests/explicit-nulls/pos" , defaultOptions and " -Yexplicit-nulls " ),
186
+ compileFilesInDir(" tests/explicit-nulls/unsafe-common" , defaultOptions and " -Yexplicit-nulls " and " -language:unsafeNulls" ),
211
187
)
212
188
}.checkCompile()
213
189
214
190
@ Test def explicitNullsRun : Unit = {
215
191
implicit val testGroup : TestGroup = TestGroup (" explicitNullsRun" )
216
- compileFilesInDir(" tests/explicit-nulls/run" , explicitNullsOptions )
192
+ compileFilesInDir(" tests/explicit-nulls/run" , defaultOptions and " -Yexplicit-nulls " )
217
193
}.checkRuns()
218
194
219
195
// initialization tests
0 commit comments