|
1 | 1 | package dotc
|
2 | 2 |
|
3 | 3 | import test._
|
4 |
| -import dotty.partest._ |
5 |
| -import org.junit.Test |
6 |
| -import org.junit.experimental.categories._ |
| 4 | +import org.junit.{Before, Test} |
7 | 5 |
|
| 6 | +import scala.reflect.io.Directory |
8 | 7 | import scala.io.Source
|
9 | 8 |
|
10 | 9 | // tests that match regex '(pos|dotc|run|java|compileStdLib)\.*' would be executed as benchmarks.
|
11 | 10 | class tests extends CompilerTest {
|
12 | 11 |
|
13 | 12 | def isRunByJenkins: Boolean = sys.props.isDefinedAt("dotty.jenkins.build")
|
14 | 13 |
|
| 14 | + val defaultOutputDir = "./out/" |
| 15 | + |
15 | 16 | val noCheckOptions = List(
|
16 | 17 | // "-verbose",
|
17 | 18 | // "-Ylog:frontend",
|
18 | 19 | // "-Xprompt",
|
19 | 20 | // "-explaintypes",
|
20 | 21 | // "-Yshow-suppressed-errors",
|
| 22 | + "-d", defaultOutputDir, |
21 | 23 | "-pagewidth", "160")
|
22 | 24 |
|
23 |
| - val defaultOutputDir = "./out/" |
24 |
| - |
25 |
| - implicit val defaultOptions = noCheckOptions ++ List( |
26 |
| - "-Yno-deep-subtypes", "-Yno-double-bindings", "-Yforce-sbt-phases", "-color:never", |
27 |
| - "-d", defaultOutputDir) ++ { |
28 |
| - if (isRunByJenkins) List("-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") // should be Ycheck:all, but #725 |
29 |
| - else List("-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") |
30 |
| - } |
| 25 | + implicit val defaultOptions = noCheckOptions ++ |
| 26 | + List("-Yno-deep-subtypes", "-Yno-double-bindings", "-Yforce-sbt-phases", "-color:never") ++ { |
| 27 | + if (isRunByJenkins) List("-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") // should be Ycheck:all, but #725 |
| 28 | + else List("-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") |
| 29 | + } |
31 | 30 |
|
32 | 31 | val testPickling = List("-Xprint-types", "-Ytest-pickler", "-Ystop-after:pickler")
|
33 | 32 |
|
@@ -60,6 +59,12 @@ class tests extends CompilerTest {
|
60 | 59 | val dottyReplDir = dotcDir + "repl/"
|
61 | 60 | val typerDir = dotcDir + "typer/"
|
62 | 61 |
|
| 62 | + @Before def cleanup(): Unit = { |
| 63 | + // remove class files from stdlib and tests compilation |
| 64 | + Directory(defaultOutputDir + "scala").deleteRecursively() |
| 65 | + Directory(defaultOutputDir + "java").deleteRecursively() |
| 66 | + } |
| 67 | + |
63 | 68 | @Test def pickle_pickleOK = compileDir(testsDir, "pickling", testPickling)
|
64 | 69 | // This directory doesn't exist anymore
|
65 | 70 | // @Test def pickle_pickling = compileDir(coreDir, "pickling", testPickling)
|
@@ -301,4 +306,23 @@ class tests extends CompilerTest {
|
301 | 306 | @Test def tasty_dotc_util = compileDir(dotcDir, "util", testPickling)
|
302 | 307 | @Test def tasty_tools_io = compileDir(toolsDir, "io", testPickling)
|
303 | 308 | @Test def tasty_tests = compileDir(testsDir, "tasty", testPickling)
|
| 309 | + |
| 310 | + @Test def tasty_bootstrap = { |
| 311 | + val opt = List("-priorityclasspath", defaultOutputDir, "-Ylog-classpath") |
| 312 | + // first compile dotty |
| 313 | + compileDir(dottyDir, ".", List("-deep", "-Ycheck-reentrant", "-strict"))(allowDeepSubtypes) |
| 314 | + |
| 315 | + compileDir(dottyDir, "tools", opt) |
| 316 | + compileDir(toolsDir, "dotc", opt) |
| 317 | + compileDir(dotcDir, "ast", opt) |
| 318 | + compileDir(dotcDir, "config", opt) |
| 319 | + compileDir(dotcDir, "parsing", opt) |
| 320 | + compileDir(dotcDir, "printing", opt) |
| 321 | + compileDir(dotcDir, "repl", opt) |
| 322 | + compileDir(dotcDir, "reporting", opt) |
| 323 | + compileDir(dotcDir, "rewrite", opt) |
| 324 | + compileDir(dotcDir, "transform", opt) |
| 325 | + compileDir(dotcDir, "typer", opt) |
| 326 | + compileDir(dotcDir, "util", opt) |
| 327 | + } |
304 | 328 | }
|
0 commit comments