Skip to content

Commit 4757a6b

Browse files
authored
Merge pull request scala#2125 from dotty-staging/topic/kill-partest
Operation Kill Partest (part 1)
2 parents 9ba9b14 + 08d75b5 commit 4757a6b

Some content is hidden

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

51 files changed

+1868
-236
lines changed

.drone.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ pipeline:
3434

3535
matrix:
3636
TEST:
37-
- ;test;dotty-bin-tests/test
38-
- ;publishLocal;dotty-bootstrapped/test
39-
- partest-only-no-bootstrap --show-diff --verbose
40-
- partest-only --show-diff --verbose
37+
- ;set testOptions in LocalProject("dotty-compiler") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;test ;dotty-bin-tests/test
38+
- ;set testOptions in LocalProject("dotty-compiler-bootstrapped") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;publishLocal ;dotty-bootstrapped/test
39+
- ;set testOptions in LocalProject("dotty-compiler") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;partest-only-no-bootstrap --show-diff --verbose
40+
- ;set testOptions in LocalProject("dotty-compiler-bootstrapped") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;partest-only --show-diff --verbose
41+
- ;dotty-compiler/testOnly dotty.tools.dotc.CompilationTests
42+
- ;publishLocal ;dotty-bootstrapped/testOnly dotty.tools.dotc.CompilationTests

.drone.yml.sig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
eyJhbGciOiJIUzI1NiJ9.cGlwZWxpbmU6CiAgdGVzdDoKICAgIGltYWdlOiBsYW1wZXBmbC9kb3R0eTpsYXRlc3QKICAgIHB1bGw6IHRydWUKICAgIGNvbW1hbmRzOgogICAgICAtIGxuIC1zIC92YXIvY2FjaGUvZH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gLS12ZXJib3NlCiAgICAtIDtkb3R0eS1jb21waWxlci90ZXN0T25seSBkb3R0eS50b29scy5kb3RjLkNvbXBpbGF0aW9uVGVzdHMKICAgIC0gO3B1Ymxpc2hMb2NhbCA7ZG90dHktYm9vdHN0cmFwcGVkL3Rlc3RPbmx5IGRvdHR5LnRvb2xzLmRvdGMuQ29tcGlsYXRpb25UZXN0cwo.b9x4iSh27OqWMUT8eR6uiK0OH_eERpnKIaMglF8hKYA

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class Compiler {
129129
.setMode(Mode.ImplicitsEnabled)
130130
.setTyperState(new MutableTyperState(ctx.typerState, ctx.typerState.reporter, isCommittable = true))
131131
.setFreshNames(new FreshNameCreator.Default)
132-
ctx.initialize()(start) // re-initialize the base context with start
132+
ctx.initialize()(start) // re-initialize the base context with start
133133
def addImport(ctx: Context, refFn: () => TermRef) =
134134
ctx.fresh.setImportInfo(ImportInfo.rootImport(refFn)(ctx))
135135
(start.setRunInfo(new RunInfo(start)) /: defn.RootImportFns)(addImport)

compiler/src/dotty/tools/dotc/reporting/ConsoleReporter.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ class ConsoleReporter(
1717

1818
import MessageContainer._
1919

20-
/** maximal number of error messages to be printed */
21-
protected def ErrorLimit = 100
22-
2320
/** Prints the message. */
2421
def printMessage(msg: String): Unit = { writer.print(msg + "\n"); writer.flush() }
2522

compiler/src/dotty/tools/dotc/reporting/Reporter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ trait Reporting { this: Context =>
6363
|This can be achieved by adding the import clause 'import $fqname'
6464
|or by setting the compiler option -language:$feature.
6565
|See the Scala docs for value $fqname for a discussion
66-
|why the feature $req be explicitly enabled."""
66+
|why the feature $req be explicitly enabled.""".stripMargin
6767
}
6868
}
6969

compiler/test/dotc/comptest.scala

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
package dotc
22

3-
import dotty.tools.dotc.CompilerTest
3+
import dotty.tools.dotc.ParallelTesting
44

5-
object comptest extends CompilerTest {
5+
object comptest extends ParallelTesting {
66

7-
override val generatePartestFiles = false
8-
val defaultOutputDir: String = ""
7+
def isInteractive = true
8+
def testFilter = None
9+
10+
implicit val defaultOutputDir: String = "."
911

1012
val posDir = "./tests/pos/"
1113
val negDir = "./tests/neg/"
1214
val dotcDir = "./src/dotty/"
1315

14-
def main(args: Array[String]) =
15-
compileList("comptest", List(
16-
dotcDir + "tools/dotc/CompilationUnit.scala",
17-
dotcDir + "tools/dotc/core/Types.scala",
18-
dotcDir + "tools/dotc/ast/Trees.scala"), List(
19-
"#runs", "2",
20-
"-Ylog:frontend",
21-
"-Xprompt"))(Nil)
22-
23-
// compileDir(dotcDir + "tools/dotc/", "printing", List("-Xprompt", "-Ylog:frontend", "#runs", "2", "-uniqid"))
16+
def main(args: Array[String]): Unit =
17+
compileList(
18+
"comptest",
19+
List(
20+
dotcDir + "tools/dotc/CompilationUnit.scala",
21+
dotcDir + "tools/dotc/core/Types.scala",
22+
dotcDir + "tools/dotc/ast/Trees.scala"
23+
),
24+
Array(
25+
"-Ylog:frontend",
26+
"-Xprompt"
27+
)
28+
)
2429
}

compiler/test/dotc/tests.scala

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class tests extends CompilerTest {
8585
val negDir = testsDir + "neg/"
8686
val runDir = testsDir + "run/"
8787
val newDir = testsDir + "new/"
88-
val replDir = testsDir + "repl/"
8988
val javaDir = testsDir + "pos-java-interop/"
9089

9190
val sourceDir = "./src/"
@@ -173,7 +172,6 @@ class tests extends CompilerTest {
173172
@Test def pos_utf16 = compileFile(posSpecialDir, "utf16encoded", explicitUTF16)
174173

175174
@Test def new_all = compileFiles(newDir, twice)
176-
@Test def repl_all = replFiles(replDir)
177175

178176
@Test def neg_all = compileFiles(negDir, verbose = true, compileSubDirs = false)
179177
@Test def neg_typedIdents() = compileDir(negDir, "typedIdents")
@@ -205,18 +203,6 @@ class tests extends CompilerTest {
205203

206204
private val stdlibFiles: List[String] = StdLibSources.whitelisted
207205

208-
@Test def checkWBLists = {
209-
val stdlibFilesBlackListed = StdLibSources.blacklisted
210-
211-
val duplicates = stdlibFilesBlackListed.groupBy(x => x).filter(_._2.size > 1).filter(_._2.size > 1)
212-
val msg = duplicates.map(x => s"'${x._1}' appears ${x._2.size} times").mkString(s"Duplicate entries in ${StdLibSources.blacklistFile}:\n", "\n", "\n")
213-
assertTrue(msg, duplicates.isEmpty)
214-
215-
val filesNotInStdLib = stdlibFilesBlackListed.toSet -- StdLibSources.all
216-
val msg2 = filesNotInStdLib.map(x => s"'$x'").mkString(s"Entries in ${StdLibSources.blacklistFile} where not found:\n", "\n", "\n")
217-
assertTrue(msg2, filesNotInStdLib.isEmpty)
218-
}
219-
220206
@Test def compileStdLib = compileList("compileStdLib", stdlibFiles, "-migration" :: "-Yno-inline" :: scala2mode)
221207
@Test def compileMixed = compileLine(
222208
"""../tests/pos/B.scala

compiler/test/dotty/partest/DPConsoleRunner.scala

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat
9090
}
9191

9292
/** Some tests require a limitation of resources, tests which are compiled
93-
* with one or more of the flags in this list will be run with
94-
* `limitedThreads`. This is necessary because some test flags require a lot
95-
* of memory when running the compiler and may exhaust the available memory
96-
* when run in parallel with too many other tests.
97-
*
98-
* This number could be increased on the CI, but might fail locally if
99-
* scaled too extreme - override with:
100-
*
101-
* ```
102-
* -Ddotty.tests.limitedThreads=X
103-
* ```
104-
*/
93+
* with one or more of the flags in this list will be run with
94+
* `limitedThreads`. This is necessary because some test flags require a lot
95+
* of memory when running the compiler and may exhaust the available memory
96+
* when run in parallel with too many other tests.
97+
*
98+
* This number could be increased on the CI, but might fail locally if
99+
* scaled too extreme - override with:
100+
*
101+
* ```
102+
* -Ddotty.tests.limitedThreads=X
103+
* ```
104+
*/
105105
def limitResourceFlags = List("-Ytest-pickler")
106106
private val limitedThreads = sys.props.get("dotty.tests.limitedThreads").getOrElse("2")
107107

compiler/test/dotty/tools/StdLibSources.scala

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package dotty.tools
22

33
import java.io.File
4-
54
import scala.io.Source
5+
import org.junit.Test
6+
import org.junit.Assert._
67

78
object StdLibSources {
89

@@ -57,3 +58,17 @@ object StdLibSources {
5758
.toList
5859

5960
}
61+
62+
class StdLibSources {
63+
@Test def checkWBLists = {
64+
val stdlibFilesBlackListed = StdLibSources.blacklisted
65+
66+
val duplicates = stdlibFilesBlackListed.groupBy(x => x).filter(_._2.size > 1).filter(_._2.size > 1)
67+
val msg = duplicates.map(x => s"'${x._1}' appears ${x._2.size} times").mkString(s"Duplicate entries in ${StdLibSources.blacklistFile}:\n", "\n", "\n")
68+
assertTrue(msg, duplicates.isEmpty)
69+
70+
val filesNotInStdLib = stdlibFilesBlackListed.toSet -- StdLibSources.all
71+
val msg2 = filesNotInStdLib.map(x => s"'$x'").mkString(s"Entries in ${StdLibSources.blacklistFile} where not found:\n", "\n", "\n")
72+
assertTrue(msg2, filesNotInStdLib.isEmpty)
73+
}
74+
}

0 commit comments

Comments
 (0)