@@ -10,6 +10,8 @@ import org.junit.experimental.categories.Category
1010import scala .concurrent .duration ._
1111import vulpix ._
1212
13+ import java .nio .file ._
14+
1315@ Category (Array (classOf [BootstrappedOnlyTests ]))
1416class BootstrappedOnlyCompilationTests extends ParallelTesting {
1517 import ParallelTesting ._
@@ -109,4 +111,27 @@ class BootstrappedOnlyCompilationTests extends ParallelTesting {
109111 compileDir(" compiler/src/dotty/tools/dotc/core/tasty" , picklingWithCompilerOptions) +
110112 compileDir(" compiler/src/dotty/tools/dotc/core/unpickleScala2" , picklingWithCompilerOptions)
111113 }.limitThreads(4 ).checkCompile()
114+
115+ @ Test def testPlugins : Unit = {
116+ val pluginFile = " plugin.properties"
117+
118+ // 1. hack with absolute path for -Xplugin
119+ // 2. copy `pluginFile` to destination
120+ def compileFilesInDir (dir : String ): CompilationTest = {
121+ val outDir = defaultOutputDir + " testPlugins/"
122+ val sourceDir = new java.io.File (dir)
123+
124+ val dirs = sourceDir.listFiles.toList.filter(_.isDirectory)
125+ val targets = dirs.map { dir =>
126+ val compileDir = createOutputDirsForDir(dir, sourceDir, outDir)
127+ Files .copy(dir.toPath.resolve(pluginFile), compileDir.toPath.resolve(pluginFile), StandardCopyOption .REPLACE_EXISTING )
128+ val flags = TestFlags (withCompilerClasspath, noCheckOptions).and(" -Xplugin:" + compileDir.getAbsolutePath)
129+ SeparateCompilationSource (" testPlugins" , dir, flags, compileDir)
130+ }
131+
132+ new CompilationTest (targets)
133+ }
134+
135+ compileFilesInDir(" tests/plugins/neg" ).checkExpectedErrors()
136+ }
112137}
0 commit comments