Skip to content

Commit 0b598e9

Browse files
committed
fix #1274: test for dotty bootstrap based on tasty
1 parent 01bd948 commit 0b598e9

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

src/dotty/tools/dotc/config/PathResolver.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,14 @@ class PathResolver(implicit ctx: Context) {
220220
import context._
221221

222222
// Assemble the elements!
223+
// Scala application class path takes precedence
223224
def basis = List[Traversable[ClassPath]](
224-
classesInPath(javaBootClassPath), // 1. The Java bootstrap class path.
225-
contentsOfDirsInPath(javaExtDirs), // 2. The Java extension class path.
226-
classesInExpandedPath(javaUserClassPath), // 3. The Java application class path.
227-
classesInPath(scalaBootClassPath), // 4. The Scala boot class path.
228-
contentsOfDirsInPath(scalaExtDirs), // 5. The Scala extension class path.
229-
classesInExpandedPath(userClassPath), // 6. The Scala application class path.
225+
classesInExpandedPath(userClassPath), // 1. The Scala application class path.
226+
classesInPath(javaBootClassPath), // 2. The Java bootstrap class path.
227+
contentsOfDirsInPath(javaExtDirs), // 3. The Java extension class path.
228+
classesInExpandedPath(javaUserClassPath), // 4. The Java application class path.
229+
classesInPath(scalaBootClassPath), // 5. The Scala boot class path.
230+
contentsOfDirsInPath(scalaExtDirs), // 6. The Scala extension class path.
230231
sourcesInPath(sourcePath) // 7. The Scala source path.
231232
)
232233

test/dotc/tests.scala

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package dotc
22

33
import test._
4-
import dotty.partest._
54
import org.junit.Test
6-
import org.junit.experimental.categories._
7-
5+
import scala.reflect.io.Directory
86
import scala.io.Source
97

108
// tests that match regex '(pos|dotc|run|java|compileStdLib)\.*' would be executed as benchmarks.
@@ -288,4 +286,26 @@ class tests extends CompilerTest {
288286
@Test def tasty_dotc_util = compileDir(dotcDir, "util", testPickling)
289287
@Test def tasty_tools_io = compileDir(toolsDir, "io", testPickling)
290288
@Test def tasty_tests = compileDir(testsDir, "tasty", testPickling)
289+
290+
@Test def tasty_bootstrap = {
291+
// remove class files from stdlib compilation
292+
Directory(defaultOutputDir + "scala").deleteRecursively()
293+
294+
val opt = List("-classpath", defaultOutputDir, "-Ylog-classpath")
295+
// first compile dotty
296+
compileDir(dottyDir, ".", List("-deep", "-Ycheck-reentrant", "-strict"))(allowDeepSubtypes)
297+
298+
compileDir(dottyDir, "tools", opt)
299+
compileDir(toolsDir, "dotc", opt)
300+
compileDir(dotcDir, "ast", opt)
301+
compileDir(dotcDir, "config", opt)
302+
compileDir(dotcDir, "parsing", opt)
303+
compileDir(dotcDir, "printing", opt)
304+
compileDir(dotcDir, "repl", opt)
305+
compileDir(dotcDir, "reporting", opt)
306+
compileDir(dotcDir, "rewrite", opt)
307+
compileDir(dotcDir, "transform", opt)
308+
compileDir(dotcDir, "typer", opt)
309+
compileDir(dotcDir, "util", opt)
310+
}
291311
}

0 commit comments

Comments
 (0)