@@ -10,6 +10,8 @@ import org.junit.experimental.categories.Category
10
10
import scala .concurrent .duration ._
11
11
import vulpix ._
12
12
13
+ import java .nio .file ._
14
+
13
15
@ Category (Array (classOf [BootstrappedOnlyTests ]))
14
16
class BootstrappedOnlyCompilationTests extends ParallelTesting {
15
17
import ParallelTesting ._
@@ -109,4 +111,27 @@ class BootstrappedOnlyCompilationTests extends ParallelTesting {
109
111
compileDir(" compiler/src/dotty/tools/dotc/core/tasty" , picklingWithCompilerOptions) +
110
112
compileDir(" compiler/src/dotty/tools/dotc/core/unpickleScala2" , picklingWithCompilerOptions)
111
113
}.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
+ }
112
137
}
0 commit comments