@@ -7,6 +7,7 @@ import org.junit.Assert._
7
7
import org .junit .Assume ._
8
8
import org .junit .experimental .categories .Category
9
9
10
+ import java .io .File
10
11
import java .nio .file ._
11
12
import java .util .stream .{ Stream => JStream }
12
13
import scala .collection .JavaConverters ._
@@ -197,45 +198,50 @@ class CompilationTests extends ParallelTesting {
197
198
*/
198
199
@ Test def tastyBootstrap : Unit = {
199
200
implicit val testGroup : TestGroup = TestGroup (" tastyBootstrap/tests" )
201
+ val libGroup = TestGroup (" tastyBootstrap/lib" )
202
+ val tastyCoreGroup = TestGroup (" tastyBootstrap/tastyCore" )
200
203
val dotty1Group = TestGroup (" tastyBootstrap/dotty1" )
201
204
val dotty2Group = TestGroup (" tastyBootstrap/dotty2" )
202
- val libGroup = TestGroup (" tastyBootstrap/lib" )
203
205
204
206
// Make sure that the directory is clean
205
207
dotty.tools.io.Directory (defaultOutputDir + " tastyBootstrap" ).deleteRecursively()
206
208
207
- val sep = java.io.File .pathSeparator
208
-
209
209
val opt = TestFlags (
210
- // compile with bootstrapped library on cp:
211
- defaultOutputDir + libGroup + " /src/" + sep +
212
- // as well as bootstrapped compiler:
213
- defaultOutputDir + dotty1Group + " /dotty/" + sep +
214
- // and the other compiler dependenies:
215
- Properties .compilerInterface + sep + Properties .scalaLibrary + sep + Properties .scalaAsm + sep +
216
- Properties .dottyInterfaces + sep + Properties .tastyCore + sep + Properties .jlineTerminal + sep +
217
- Properties .jlineReader,
210
+ List (
211
+ // compile with bootstrapped library on cp:
212
+ defaultOutputDir + libGroup + " /lib/" ,
213
+ // and bootstrapped tasty-core:
214
+ defaultOutputDir + tastyCoreGroup + " /tastyCore/" ,
215
+ // as well as bootstrapped compiler:
216
+ defaultOutputDir + dotty1Group + " /dotty1/" ,
217
+ // and the other compiler dependencies:
218
+ Properties .compilerInterface, Properties .scalaLibrary, Properties .scalaAsm,
219
+ Properties .dottyInterfaces, Properties .jlineTerminal, Properties .jlineReader,
220
+ ).mkString(File .pathSeparator),
218
221
Array (" -Ycheck-reentrant" , " -Yemit-tasty-in-class" )
219
222
)
220
223
221
224
val libraryDirs = List (Paths .get(" library/src" ), Paths .get(" library/src-bootstrapped" ))
222
225
val librarySources = libraryDirs.flatMap(sources(_))
223
226
224
227
val lib =
225
- compileList(" src " , librarySources,
228
+ compileList(" lib " , librarySources,
226
229
defaultOptions.and(" -Ycheck-reentrant" ,
227
230
" -Yerased-terms" , // support declaration of scala.compiletime.erasedValue
228
231
// "-strict", // TODO: re-enable once we allow : @unchecked in pattern definitions. Right now, lots of narrowing pattern definitions fail.
229
232
" -priorityclasspath" , defaultOutputDir))(libGroup)
230
233
234
+ val tastyCoreSources = sources(Paths .get(" tasty/src" ))
235
+ val tastyCore = compileList(" tastyCore" , tastyCoreSources, opt)(tastyCoreGroup)
236
+
231
237
val compilerSources = sources(Paths .get(" compiler/src" ))
232
238
val compilerManagedSources = sources(Properties .dottyCompilerManagedSources)
233
239
234
- val dotty1 = compileList(" dotty " , compilerSources ++ compilerManagedSources, opt)(dotty1Group)
235
- val dotty2 = compileList(" dotty " , compilerSources ++ compilerManagedSources, opt)(dotty2Group)
240
+ val dotty1 = compileList(" dotty1 " , compilerSources ++ compilerManagedSources, opt)(dotty1Group)
241
+ val dotty2 = compileList(" dotty2 " , compilerSources ++ compilerManagedSources, opt)(dotty2Group)
236
242
237
243
val tests = {
238
- lib.keepOutput :: dotty1.keepOutput :: aggregateTests(
244
+ lib.keepOutput :: tastyCore.keepOutput :: dotty1.keepOutput :: aggregateTests(
239
245
dotty2,
240
246
compileShallowFilesInDir(" compiler/src/dotty/tools" , opt),
241
247
compileShallowFilesInDir(" compiler/src/dotty/tools/dotc" , opt),
@@ -255,9 +261,10 @@ class CompilationTests extends ParallelTesting {
255
261
}.map(_.checkCompile())
256
262
257
263
def assertExists (path : String ) = assertTrue(Files .exists(Paths .get(path)))
258
- assertExists(s " out/ $dotty1Group/dotty/ " )
259
- assertExists(s " out/ $dotty2Group/dotty/ " )
260
- assertExists(s " out/ $libGroup/src/ " )
264
+ assertExists(s " out/ $libGroup/lib/ " )
265
+ assertExists(s " out/ $tastyCoreGroup/tastyCore/ " )
266
+ assertExists(s " out/ $dotty1Group/dotty1/ " )
267
+ assertExists(s " out/ $dotty2Group/dotty2/ " )
261
268
compileList(" idempotency" , List (" tests/idempotency/BootstrapChecker.scala" , " tests/idempotency/IdempotencyCheck.scala" ), defaultOptions).checkRuns()
262
269
263
270
tests.foreach(_.delete())
0 commit comments