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