@@ -99,7 +99,7 @@ class CompilationTests extends ParallelTesting {
99
99
compileDir(" ../tests/pos/i1137-1" , defaultOptions and " -Yemit-tasty" ) +
100
100
compileFile(
101
101
// succeeds despite -Xfatal-warnings because of -nowarn
102
- " ../tests/neg/customArgs /xfatalWarnings.scala" ,
102
+ " ../tests/neg-custom-args /xfatalWarnings.scala" ,
103
103
defaultOptions.and(" -nowarn" , " -Xfatal-warnings" )
104
104
)
105
105
}.checkCompile()
@@ -165,30 +165,25 @@ class CompilationTests extends ParallelTesting {
165
165
166
166
@ Test def compileNeg : Unit = {
167
167
implicit val testGroup : TestGroup = TestGroup (" compileNeg" )
168
- compileShallowFilesInDir(" ../tests/neg" , defaultOptions) +
169
- compileShallowFilesInDir(" ../tests/neg/no-optimise" , defaultOptions) +
170
- compileFile(" ../tests/neg/customArgs/typers.scala" , allowDoubleBindings) +
171
- compileFile(" ../tests/neg/customArgs/overrideClass.scala" , scala2Mode) +
172
- compileFile(" ../tests/neg/customArgs/autoTuplingTest.scala" , defaultOptions.and(" -language:noAutoTupling" )) +
173
- compileFile(" ../tests/neg/customArgs/i1050.scala" , defaultOptions.and(" -strict" )) +
174
- compileFile(" ../tests/neg/customArgs/i1240.scala" , allowDoubleBindings) +
175
- compileFile(" ../tests/neg/customArgs/i2002.scala" , allowDoubleBindings) +
176
- compileFile(" ../tests/neg/customArgs/nopredef.scala" , defaultOptions.and(" -Yno-predef" )) +
177
- compileFile(" ../tests/neg/customArgs/noimports.scala" , defaultOptions.and(" -Yno-imports" )) +
178
- compileFile(" ../tests/neg/customArgs/noimports2.scala" , defaultOptions.and(" -Yno-imports" )) +
179
- compileFile(" ../tests/neg/customArgs/overloadsOnAbstractTypes.scala" , allowDoubleBindings) +
180
- compileFile(" ../tests/neg/customArgs/xfatalWarnings.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
181
- compileFile(" ../tests/neg/customArgs/pureStatement.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
182
- compileFile(" ../tests/neg/customArgs/phantom-overload.scala" , allowDoubleBindings) +
183
- compileFile(" ../tests/neg/customArgs/phantom-overload-2.scala" , allowDoubleBindings) +
184
- compileFile(" ../tests/neg/tailcall/t1672b.scala" , defaultOptions) +
185
- compileFile(" ../tests/neg/tailcall/t3275.scala" , defaultOptions) +
186
- compileFile(" ../tests/neg/tailcall/t6574.scala" , defaultOptions) +
187
- compileFile(" ../tests/neg/tailcall/tailrec.scala" , defaultOptions) +
188
- compileFile(" ../tests/neg/tailcall/tailrec-2.scala" , defaultOptions) +
189
- compileFile(" ../tests/neg/tailcall/tailrec-3.scala" , defaultOptions) +
190
- compileFile(" ../tests/neg/i3246.scala" , scala2Mode) +
191
- compileDir(" ../tests/neg/typedIdents" , defaultOptions)
168
+ compileFilesInDir(" ../tests/neg" , defaultOptions) +
169
+ compileFilesInDir(" ../tests/neg-tailcall" , defaultOptions) +
170
+ compileFilesInDir(" ../tests/neg-no-optimise" , defaultOptions) +
171
+ compileFile(" ../tests/neg-custom-args/i3246.scala" , scala2Mode) +
172
+ compileFile(" ../tests/neg-custom-args/typers.scala" , allowDoubleBindings) +
173
+ compileFile(" ../tests/neg-custom-args/overrideClass.scala" , scala2Mode) +
174
+ compileFile(" ../tests/neg-custom-args/autoTuplingTest.scala" , defaultOptions.and(" -language:noAutoTupling" )) +
175
+ compileFile(" ../tests/neg-custom-args/i1050.scala" , defaultOptions.and(" -strict" )) +
176
+ compileFile(" ../tests/neg-custom-args/i1240.scala" , allowDoubleBindings) +
177
+ compileFile(" ../tests/neg-custom-args/i2002.scala" , allowDoubleBindings) +
178
+ compileFile(" ../tests/neg-custom-args/nopredef.scala" , defaultOptions.and(" -Yno-predef" )) +
179
+ compileFile(" ../tests/neg-custom-args/noimports.scala" , defaultOptions.and(" -Yno-imports" )) +
180
+ compileFile(" ../tests/neg-custom-args/noimports2.scala" , defaultOptions.and(" -Yno-imports" )) +
181
+ compileFile(" ../tests/neg-custom-args/overloadsOnAbstractTypes.scala" , allowDoubleBindings) +
182
+ compileFile(" ../tests/neg-custom-args/xfatalWarnings.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
183
+ compileFile(" ../tests/neg-custom-args/pureStatement.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
184
+ compileFile(" ../tests/neg-custom-args/phantom-overload.scala" , allowDoubleBindings) +
185
+ compileFile(" ../tests/neg-custom-args/phantom-overload-2.scala" , allowDoubleBindings) +
186
+ compileFile(" ../tests/neg-custom-args/structural.scala" , defaultOptions.and(" -Xfatal-warnings" ))
192
187
}.checkExpectedErrors()
193
188
194
189
// Run tests -----------------------------------------------------------------
@@ -311,7 +306,7 @@ class CompilationTests extends ParallelTesting {
311
306
implicit val testGroup : TestGroup = TestGroup (" optimised/testOptimised" )
312
307
compileFilesInDir(" ../tests/pos" , defaultOptimised).checkCompile()
313
308
compileFilesInDir(" ../tests/run" , defaultOptimised).checkRuns()
314
- compileShallowFilesInDir (" ../tests/neg" , defaultOptimised).checkExpectedErrors()
309
+ compileFilesInDir (" ../tests/neg" , defaultOptimised).checkExpectedErrors()
315
310
}
316
311
317
312
private val (compilerSources, backendSources, backendJvmSources) = {
@@ -340,10 +335,14 @@ object CompilationTests {
340
335
implicit val summaryReport : SummaryReporting = new SummaryReport
341
336
@ AfterClass def cleanup (): Unit = summaryReport.echoSummary()
342
337
343
- def sources (paths : JStream [Path ], excludedFiles : List [String ] = Nil ): List [String ] =
344
- paths.iterator().asScala
338
+ def sources (paths : JStream [Path ], excludedFiles : List [String ] = Nil ): List [String ] = {
339
+ val sources = paths.iterator().asScala
345
340
.filter(path =>
346
341
(path.toString.endsWith(" .scala" ) || path.toString.endsWith(" .java" ))
347
342
&& ! excludedFiles.contains(path.getFileName.toString))
348
343
.map(_.toString).toList
344
+
345
+ paths.close()
346
+ sources
347
+ }
349
348
}
0 commit comments