@@ -17,6 +17,7 @@ import scala.util.matching.Regex
17
17
import scala .concurrent .duration ._
18
18
import TestSources .sources
19
19
import vulpix ._
20
+ import dotty .tools .dotc .config .ScalaSettings
20
21
21
22
class CompilationTests {
22
23
import ParallelTesting ._
@@ -265,7 +266,6 @@ class CompilationTests {
265
266
compileFilesInDir(" tests/init/neg" , options).checkExpectedErrors()
266
267
compileFilesInDir(" tests/init/pos" , options).checkCompile()
267
268
compileFilesInDir(" tests/init/crash" , options.without(" -Xfatal-warnings" )).checkCompile()
268
-
269
269
// The regression test for i12128 has some atypical classpath requirements.
270
270
// The test consists of three files: (a) Reflect_1 (b) Macro_2 (c) Test_3
271
271
// which must be compiled separately. In addition:
@@ -287,6 +287,38 @@ class CompilationTests {
287
287
tests.foreach(_.delete())
288
288
}
289
289
}
290
+
291
+ // parallel backend tests
292
+ @ Test def parallelBackend : Unit = {
293
+ given TestGroup = TestGroup (" parallelBackend" )
294
+ val parallelism = Runtime .getRuntime().availableProcessors().min(16 )
295
+ assumeTrue(" Not enough available processors to run parallel tests" , parallelism > 1 )
296
+
297
+ val options = defaultOptions.and(s " -Ybackend-parallelism: ${parallelism}" )
298
+ def parCompileDir (directory : String ) = compileDir(directory, options)
299
+
300
+ // Compilation units containing more then 1 source file
301
+ aggregateTests(
302
+ parCompileDir(" tests/pos/i10477" ),
303
+ parCompileDir(" tests/pos/i4758" ),
304
+ parCompileDir(" tests/pos/scala2traits" ),
305
+ parCompileDir(" tests/pos/class-gadt" ),
306
+ parCompileDir(" tests/pos/tailcall" ),
307
+ parCompileDir(" tests/pos/reference" ),
308
+ parCompileDir(" tests/pos/pos_valueclasses" )
309
+ ).checkCompile()
310
+
311
+ aggregateTests(
312
+ parCompileDir(" tests/neg/package-implicit" ),
313
+ parCompileDir(" tests/neg/package-export" )
314
+ ).checkExpectedErrors()
315
+
316
+ aggregateTests(
317
+ parCompileDir(" tests/run/decorators" ),
318
+ parCompileDir(" tests/run/generic" )
319
+ ).checkRuns()
320
+
321
+ }
290
322
}
291
323
292
324
object CompilationTests extends ParallelTesting {
0 commit comments