@@ -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 ._
@@ -212,7 +213,6 @@ class CompilationTests {
212
213
compileFilesInDir(" tests/init/warn" , defaultOptions.and(" -Ysafe-init" )).checkWarnings()
213
214
compileFilesInDir(" tests/init/pos" , options).checkCompile()
214
215
compileFilesInDir(" tests/init/crash" , options.without(" -Xfatal-warnings" )).checkCompile()
215
-
216
216
// The regression test for i12128 has some atypical classpath requirements.
217
217
// The test consists of three files: (a) Reflect_1 (b) Macro_2 (c) Test_3
218
218
// which must be compiled separately. In addition:
@@ -234,6 +234,38 @@ class CompilationTests {
234
234
tests.foreach(_.delete())
235
235
}
236
236
}
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
+ }
237
269
}
238
270
239
271
object CompilationTests extends ParallelTesting {
0 commit comments