@@ -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 ._
@@ -219,7 +220,6 @@ class CompilationTests {
219
220
compileFilesInDir(" tests/init/neg" , options).checkExpectedErrors()
220
221
compileFilesInDir(" tests/init/pos" , options).checkCompile()
221
222
compileFilesInDir(" tests/init/crash" , options.without(" -Xfatal-warnings" )).checkCompile()
222
-
223
223
// The regression test for i12128 has some atypical classpath requirements.
224
224
// The test consists of three files: (a) Reflect_1 (b) Macro_2 (c) Test_3
225
225
// which must be compiled separately. In addition:
@@ -241,6 +241,38 @@ class CompilationTests {
241
241
tests.foreach(_.delete())
242
242
}
243
243
}
244
+
245
+ // parallel backend tests
246
+ @ Test def parallelBackend : Unit = {
247
+ given TestGroup = TestGroup (" parallelBackend" )
248
+ val parallelism = Runtime .getRuntime().availableProcessors().min(16 )
249
+ assumeTrue(" Not enough available processors to run parallel tests" , parallelism > 1 )
250
+
251
+ val options = defaultOptions.and(s " -Ybackend-parallelism: ${parallelism}" )
252
+ def parCompileDir (directory : String ) = compileDir(directory, options)
253
+
254
+ // Compilation units containing more than 1 source file
255
+ aggregateTests(
256
+ parCompileDir(" tests/pos/i10477" ),
257
+ parCompileDir(" tests/pos/i4758" ),
258
+ parCompileDir(" tests/pos/scala2traits" ),
259
+ parCompileDir(" tests/pos/class-gadt" ),
260
+ parCompileDir(" tests/pos/tailcall" ),
261
+ parCompileDir(" tests/pos/reference" ),
262
+ parCompileDir(" tests/pos/pos_valueclasses" )
263
+ ).checkCompile()
264
+
265
+ aggregateTests(
266
+ parCompileDir(" tests/neg/package-implicit" ),
267
+ parCompileDir(" tests/neg/package-export" )
268
+ ).checkExpectedErrors()
269
+
270
+ aggregateTests(
271
+ parCompileDir(" tests/run/decorators" ),
272
+ parCompileDir(" tests/run/generic" )
273
+ ).checkRuns()
274
+
275
+ }
244
276
}
245
277
246
278
object CompilationTests extends ParallelTesting {
0 commit comments