1
1
package dotc
2
2
3
3
import test ._
4
- import org .junit .Test
4
+ import org .junit .{Before , Test }
5
+
5
6
import scala .reflect .io .Directory
6
7
import scala .io .Source
7
8
@@ -10,19 +11,19 @@ class tests extends CompilerTest {
10
11
11
12
def isRunByJenkins : Boolean = sys.props.isDefinedAt(" dotty.jenkins.build" )
12
13
14
+ val defaultOutputDir = " ./out/"
15
+
13
16
val noCheckOptions = List (
14
17
// "-verbose",
15
18
// "-Ylog:frontend",
16
19
// "-Xprompt",
17
20
// "-explaintypes",
18
21
// "-Yshow-suppressed-errors",
22
+ " -d" , defaultOutputDir,
19
23
" -pagewidth" , " 160" )
20
24
21
- val defaultOutputDir = " ./out/"
22
-
23
- implicit val defaultOptions = noCheckOptions ++ List (
24
- " -Yno-deep-subtypes" , " -Yno-double-bindings" , " -Yforce-sbt-phases" ,
25
- " -d" , defaultOutputDir) ++ {
25
+ implicit val defaultOptions = noCheckOptions ++
26
+ List (" -Yno-deep-subtypes" , " -Yno-double-bindings" , " -Yforce-sbt-phases" ) ++ {
26
27
if (isRunByJenkins) List (" -Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef" ) // should be Ycheck:all, but #725
27
28
else List (" -Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef" )
28
29
}
@@ -55,6 +56,12 @@ class tests extends CompilerTest {
55
56
val dottyReplDir = dotcDir + " repl/"
56
57
val typerDir = dotcDir + " typer/"
57
58
59
+ @ Before def cleanup (): Unit = {
60
+ // remove class files from stdlib and tests compilation
61
+ Directory (defaultOutputDir + " scala" ).deleteRecursively()
62
+ Directory (defaultOutputDir + " java" ).deleteRecursively()
63
+ }
64
+
58
65
@ Test def pickle_pickleOK = compileDir(testsDir, " pickling" , testPickling)
59
66
// This directory doesn't exist anymore
60
67
// @Test def pickle_pickling = compileDir(coreDir, "pickling", testPickling)
@@ -288,10 +295,6 @@ class tests extends CompilerTest {
288
295
@ Test def tasty_tests = compileDir(testsDir, " tasty" , testPickling)
289
296
290
297
@ Test def tasty_bootstrap = {
291
- // remove class files from stdlib and tests compilation
292
- Directory (defaultOutputDir + " scala" ).deleteRecursively()
293
- Directory (defaultOutputDir + " java" ).deleteRecursively()
294
-
295
298
val opt = List (" -classpath" , defaultOutputDir, " -Ylog-classpath" )
296
299
// first compile dotty
297
300
compileDir(dottyDir, " ." , List (" -deep" , " -Ycheck-reentrant" , " -strict" ))(allowDeepSubtypes)
0 commit comments