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