@@ -18,6 +18,7 @@ import scala.concurrent.duration._
1818import TestSources .sources
1919import reporting .TestReporter
2020import vulpix ._
21+ import dotty .tools .dotc .config .ScalaSettings
2122
2223class CompilationTests {
2324 import ParallelTesting ._
@@ -212,7 +213,6 @@ class CompilationTests {
212213 compileFilesInDir(" tests/init/warn" , defaultOptions.and(" -Ysafe-init" )).checkWarnings()
213214 compileFilesInDir(" tests/init/pos" , options).checkCompile()
214215 compileFilesInDir(" tests/init/crash" , options.without(" -Xfatal-warnings" )).checkCompile()
215-
216216 // The regression test for i12128 has some atypical classpath requirements.
217217 // The test consists of three files: (a) Reflect_1 (b) Macro_2 (c) Test_3
218218 // which must be compiled separately. In addition:
@@ -234,6 +234,38 @@ class CompilationTests {
234234 tests.foreach(_.delete())
235235 }
236236 }
237+
238+ // parallel backend tests
239+ @ Test def parallelBackend : Unit = {
240+ given TestGroup = TestGroup (" parallelBackend" )
241+ val parallelism = Runtime .getRuntime().availableProcessors().min(16 )
242+ assumeTrue(" Not enough available processors to run parallel tests" , parallelism > 1 )
243+
244+ val options = defaultOptions.and(s " -Ybackend-parallelism: ${parallelism}" )
245+ def parCompileDir (directory : String ) = compileDir(directory, options)
246+
247+ // Compilation units containing more than 1 source file
248+ aggregateTests(
249+ parCompileDir(" tests/pos/i10477" ),
250+ parCompileDir(" tests/pos/i4758" ),
251+ parCompileDir(" tests/pos/scala2traits" ),
252+ parCompileDir(" tests/pos/class-gadt" ),
253+ parCompileDir(" tests/pos/tailcall" ),
254+ parCompileDir(" tests/pos/reference" ),
255+ parCompileDir(" tests/pos/pos_valueclasses" )
256+ ).checkCompile()
257+
258+ aggregateTests(
259+ parCompileDir(" tests/neg/package-implicit" ),
260+ parCompileDir(" tests/neg/package-export" )
261+ ).checkExpectedErrors()
262+
263+ aggregateTests(
264+ parCompileDir(" tests/run/decorators" ),
265+ parCompileDir(" tests/run/generic" )
266+ ).checkRuns()
267+
268+ }
237269}
238270
239271object CompilationTests extends ParallelTesting {
0 commit comments