Skip to content

Commit 8a61ff4

Browse files
felixmuldersmarter
authored andcommitted
Move compiler and compiler tests to compiler dir
1 parent 6a455fe commit 8a61ff4

File tree

329 files changed

+84
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+84
-74
lines changed

bench/src/test/scala/Benchmarks.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.scalameter.PerformanceTest.OnlineRegressionReport
66
import org.scalameter.api._
77
import org.scalameter.{Context, History, currentContext, persistence}
88
import org.scalameter.reporting.RegressionReporter.Tester
9-
import test.CompilerTest
9+
import dotty.tools.dotc.CompilerTest
1010

1111
import scala.io.Source
1212

@@ -46,13 +46,14 @@ object BenchTests extends OnlineRegressionReport {
4646
implicit val defaultOptions = List("-d", outputDir)
4747
val scala2mode = List("-language:Scala2")
4848

49-
val dottyDir = "./src/dotty/"
49+
val dottyDir = "../compiler/src/dotty/"
5050

51-
val stdlibFiles = Source.fromFile("./test/dotc/scala-collections.whitelist", "UTF8").getLines()
51+
val stdlibFiles = Source.fromFile("../compiler/test/dotc/scala-collections.whitelist", "UTF8").getLines()
5252
.map(_.trim) // allow identation
5353
.filter(!_.startsWith("#")) // allow comment lines prefixed by #
5454
.map(_.takeWhile(_ != '#').trim) // allow comments in the end of line
5555
.filter(_.nonEmpty)
56+
.map("." + _)
5657
.toList
5758

5859
def stdLib = compiler.compileList("compileStdLib", stdlibFiles, "-migration" :: scala2mode)

bin/common

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ function build_all {
8686
printf "done\n"
8787

8888
printf "Building dotty-compiler..."
89-
MAIN_JAR=$(build_jar dotty-compiler/package "target/scala-$SCALA_BINARY_VERSION")
89+
MAIN_JAR=$(build_jar dotty-compiler/package "compiler/target/scala-$SCALA_BINARY_VERSION")
9090
printf "done\n"
9191

9292
printf "Building dotty library..."
9393
DOTTY_LIB_JAR=$(build_jar dotty-library/package "library/target/scala-$SCALA_BINARY_VERSION")
9494
printf "done\n"
9595

9696
printf "Building tests..."
97-
TEST_JAR=$(build_jar test:package "target/scala-$SCALA_BINARY_VERSION" '/dotty.*-tests\.jar/p')
97+
TEST_JAR=$(build_jar test:package "compiler/target/scala-$SCALA_BINARY_VERSION" '/dotty.*-tests\.jar/p')
9898
printf "done\n"
9999

100100
update_packages
@@ -130,10 +130,10 @@ function check_jar {
130130
fi
131131
}
132132

133-
check_jar "dotty-interfaces" $INTERFACES_JAR "interfaces" 'INTERFACES_JAR=$(build_jar dotty-interfaces/package interfaces/target)'
134-
check_jar "dotty" $MAIN_JAR "src" 'MAIN_JAR=$(build_jar dotty-compiler/package target/scala-$SCALA_BINARY_VERSION)'
135-
check_jar "dotty-library" $DOTTY_LIB_JAR "library" 'DOTTY_LIB_JAR=$(build_jar dotty-library/package library/target/scala-$SCALA_BINARY_VERSION)'
136-
check_jar "dotty-tests" $TEST_JAR "test" 'TEST_JAR=$(build_jar test:package target/scala-$SCALA_BINARY_VERSION /dotty.*-tests\.jar/p)'
133+
check_jar "dotty-interfaces" $INTERFACES_JAR "interfaces/src" 'INTERFACES_JAR=$(build_jar dotty-interfaces/package interfaces/target)'
134+
check_jar "dotty" $MAIN_JAR "compiler/src" 'MAIN_JAR=$(build_jar dotty-compiler/package compiler/target/scala-$SCALA_BINARY_VERSION)'
135+
check_jar "dotty-library" $DOTTY_LIB_JAR "library/src" 'DOTTY_LIB_JAR=$(build_jar dotty-library/package library/target/scala-$SCALA_BINARY_VERSION)'
136+
check_jar "dotty-tests" $TEST_JAR "compiler/test" 'TEST_JAR=$(build_jar dotty-compiler/test:package compiler/target/scala-$SCALA_BINARY_VERSION /dotty.*-tests\.jar/p)'
137137

138138
# Autodetecting the scala-library location, in case it wasn't provided by an environment variable
139139
if [ "$SCALA_LIBRARY_JAR" == "" ]; then

bin/test/TestScripts.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class TestScripts {
2828
}
2929

3030
try {
31-
for (jar <- Source.fromFile("../.packages").getLines())
31+
for (jar <- Source.fromFile("./.packages").getLines())
3232
delete(jar)
3333

34-
delete("../.packages")
35-
delete("./src/dotty/tools/dotc/Dummy.scala")
36-
delete("HelloWorld.class")
37-
delete("HelloWorld$.class")
34+
delete("./.packages")
35+
delete("./compiler/src/dotty/tools/dotc/Dummy.scala")
36+
delete("./HelloWorld.class")
37+
delete("./HelloWorld$.class")
3838
} catch {
3939
case _: FileNotFoundException => ()
4040
}
@@ -66,11 +66,11 @@ class TestScripts {
6666
* rebuild dotty if needed
6767
*/
6868
@Test def rebuildIfNecessary = doUnlessWindows {
69-
val (retFirstBuild, _) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
70-
assert(retFirstBuild == 0, "building dotc failed")
69+
val (retFirstBuild, out1) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
70+
assert(retFirstBuild == 0, s"building dotc failed: $out1")
7171

7272
// Create a new file to force rebuild
73-
new JFile("./src/dotty/tools/dotc/Dummy.scala").createNewFile()
73+
new JFile("./compiler/src/dotty/tools/dotc/Dummy.scala").createNewFile()
7474

7575
val (retSecondBuild, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
7676
assert(
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/dotc/tests.scala renamed to compiler/test/dotc/tests.scala

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class tests extends CompilerTest {
1212

1313
def isRunByJenkins: Boolean = sys.props.isDefinedAt("dotty.jenkins.build")
1414

15-
val defaultOutputDir = "./out/"
15+
val defaultOutputDir = "../out/"
1616

1717
val noCheckOptions = List(
1818
// "-verbose",
@@ -33,9 +33,9 @@ class tests extends CompilerTest {
3333

3434
val classPath = {
3535
val paths = List(
36-
"./library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar",
36+
"../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar",
3737
"./target/scala-2.11/dotty-compiler_2.11-0.1-SNAPSHOT.jar",
38-
"./interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar"
38+
"../interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar"
3939
).map { p =>
4040
val file = new JFile(p)
4141
assert(
@@ -65,7 +65,7 @@ class tests extends CompilerTest {
6565
val explicitUTF8 = List("-encoding", "UTF8")
6666
val explicitUTF16 = List("-encoding", "UTF16")
6767

68-
val testsDir = "./tests/"
68+
val testsDir = "../tests/"
6969
val posDir = testsDir + "pos/"
7070
val posSpecialDir = testsDir + "pos-special/"
7171
val posScala2Dir = testsDir + "pos-scala2/"
@@ -83,7 +83,7 @@ class tests extends CompilerTest {
8383
val parsingDir = dotcDir + "parsing/"
8484
val dottyReplDir = dotcDir + "repl/"
8585
val typerDir = dotcDir + "typer/"
86-
val libDir = "./library/src/"
86+
val libDir = "../library/src/"
8787

8888
@Before def cleanup(): Unit = {
8989
// remove class files from stdlib and tests compilation
@@ -190,18 +190,19 @@ class tests extends CompilerTest {
190190
.filter(!_.startsWith("#")) // allow comment lines prefixed by #
191191
.map(_.takeWhile(_ != '#').trim) // allow comments in the end of line
192192
.filter(_.nonEmpty)
193+
.map("." + _) // files are contained one dir up
193194
.toList
194195

195196
@Test def compileStdLib = compileList("compileStdLib", stdlibFiles, "-migration" :: "-Yno-inline" :: scala2mode)
196197
@Test def compileMixed = compileLine(
197-
"""tests/pos/B.scala
198-
|./scala-scala/src/library/scala/collection/immutable/Seq.scala
199-
|./scala-scala/src/library/scala/collection/parallel/ParSeq.scala
200-
|./scala-scala/src/library/scala/package.scala
201-
|./scala-scala/src/library/scala/collection/GenSeqLike.scala
202-
|./scala-scala/src/library/scala/collection/SeqLike.scala
203-
|./scala-scala/src/library/scala/collection/generic/GenSeqFactory.scala""".stripMargin)
204-
@Test def compileIndexedSeq = compileLine("./scala-scala/src/library/scala/collection/immutable/IndexedSeq.scala")
198+
"""../tests/pos/B.scala
199+
|../scala-scala/src/library/scala/collection/immutable/Seq.scala
200+
|../scala-scala/src/library/scala/collection/parallel/ParSeq.scala
201+
|../scala-scala/src/library/scala/package.scala
202+
|../scala-scala/src/library/scala/collection/GenSeqLike.scala
203+
|../scala-scala/src/library/scala/collection/SeqLike.scala
204+
|../scala-scala/src/library/scala/collection/generic/GenSeqFactory.scala""".stripMargin)
205+
@Test def compileIndexedSeq = compileLine("../scala-scala/src/library/scala/collection/immutable/IndexedSeq.scala")
205206

206207
// Not a junit test anymore since it is order dependent
207208
def dottyBootedLib = compileDir(libDir, ".")(allowDeepSubtypes) // note the -deep argument

test/dotty/partest/DPConfig.scala renamed to compiler/test/dotty/partest/DPConfig.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ object DPConfig {
2323
*/
2424
val runJVMOpts = s"-Xms64M -Xmx1024M ${PartestDefaults.javaOpts}"
2525

26-
val testRoot = (Path(".") / Path("tests") / Path("partest-generated")).toString
26+
val testRoot = (Path("..") / Path("tests") / Path("partest-generated")).toString
2727
val genLog = Path(testRoot) / Path("gen.log")
2828

2929
lazy val testDirs = {

test/dotty/tools/DottyTest.scala renamed to compiler/test/dotty/tools/DottyTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DottyTest extends ContextEscapeDetection{
2525
ctx.setSetting(ctx.settings.encoding, "UTF8")
2626
ctx.setSetting(
2727
ctx.settings.classpath,
28-
"./library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar"
28+
"../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar"
2929
)
3030
// when classpath is changed in ctx, we need to re-initialize to get the
3131
// correct classpath from PathResolver

test/dotty/tools/ShowClassTests.scala renamed to compiler/test/dotty/tools/ShowClassTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class ShowClassTests extends DottyTest {
1818
ctx.setSetting(ctx.settings.encoding, "UTF8")
1919
ctx.setSetting(
2020
ctx.settings.classpath,
21-
"./library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar" +
22-
":./interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar"
21+
"../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar" +
22+
":../interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar"
2323
)
2424
base.initialize()(ctx)
2525
ctx

test/dotty/tools/dotc/CompilerTest.scala renamed to compiler/test/dotty/tools/dotc/CompilerTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ abstract class CompilerTest {
6363
if (pid == null)
6464
false
6565
else
66-
new JFile("." + JFile.separator + "tests" + JFile.separator + "locks" + JFile.separator + s"partest-$pid.lock").exists
66+
new JFile(".." + JFile.separator + "tests" + JFile.separator + "locks" + JFile.separator + s"partest-$pid.lock").exists
6767
}
6868

6969
// Delete generated files from previous run and create new log

test/dotty/tools/dotc/EntryPointsTest.scala renamed to compiler/test/dotty/tools/dotc/EntryPointsTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ import scala.collection.mutable.ListBuffer
1818
*/
1919
class EntryPointsTest {
2020
private val sources =
21-
List("./tests/pos/HelloWorld.scala").map(p => new java.io.File(p).getPath())
21+
List("../tests/pos/HelloWorld.scala").map(p => new java.io.File(p).getPath())
2222
private val dottyInterfaces =
23-
new java.io.File("./interfaces/dotty-interfaces-0.1-SNAPSHOT.jar").getPath
23+
new java.io.File("../interfaces/dotty-interfaces-0.1-SNAPSHOT.jar").getPath
2424
private val dottyLibrary =
25-
new java.io.File("./library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar").getPath
25+
new java.io.File("../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar").getPath
2626
private val args =
2727
sources ++
28-
List("-d", "./out/") ++
28+
List("-d", "../out/") ++
2929
List("-classpath", dottyInterfaces + ":" + dottyLibrary)
3030

3131
@Test def runCompiler = {

test/dotty/tools/dotc/InterfaceEntryPointTest.scala renamed to compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ import scala.collection.mutable.ListBuffer
1919
class InterfaceEntryPointTest {
2020
@Test def runCompilerFromInterface = {
2121
val sources =
22-
List("./tests/pos/HelloWorld.scala").map(p => new java.io.File(p).getPath())
22+
List("../tests/pos/HelloWorld.scala").map(p => new java.io.File(p).getPath())
2323
val dottyInterfaces =
24-
new java.io.File("./interfaces/dotty-interfaces-0.1-SNAPSHOT.jar").getPath
24+
new java.io.File("../interfaces/dotty-interfaces-0.1-SNAPSHOT.jar").getPath
2525
val dottyLibrary =
26-
new java.io.File("./library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar").getPath
26+
new java.io.File("../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar").getPath
2727

2828
val args =
2929
sources ++
30-
List("-d", "./out/") ++
30+
List("-d", "../out/") ++
3131
List("-classpath", dottyInterfaces + ":" + dottyLibrary)
3232

3333
val mainClass = Class.forName("dotty.tools.dotc.Main")

0 commit comments

Comments
 (0)