Skip to content

Reduce running time of testPickling #3642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ class CompilationTests extends ParallelTesting {

@Test def testPickling: Unit = {
implicit val testGroup: TestGroup = TestGroup("testPickling")
compileDir("../compiler/src/dotty/tools", picklingOptions) +
compileDir("../compiler/src/dotty/tools/dotc", picklingOptions) +
compileDir("../compiler/src/dotty/tools", picklingOptions, recursive = false) +
compileDir("../compiler/src/dotty/tools/dotc", picklingOptions, recursive = false) +
compileFilesInDir("../tests/new", picklingOptions) +
compileFilesInDir("../tests/pickling", picklingOptions) +
compileDir("../library/src/dotty/runtime", picklingOptions) +
compileDir("../compiler/src/dotty/tools/backend/jvm", picklingOptions) +
compileDir("../compiler/src/dotty/tools/dotc/ast", picklingOptions) +
compileDir("../compiler/src/dotty/tools/dotc/core", picklingOptions) +
compileDir("../compiler/src/dotty/tools/dotc/core", picklingOptions, recursive = false) +
compileDir("../compiler/src/dotty/tools/dotc/config", picklingOptions) +
compileDir("../compiler/src/dotty/tools/dotc/parsing", picklingOptions) +
compileDir("../compiler/src/dotty/tools/dotc/printing", picklingOptions) +
Expand Down
7 changes: 5 additions & 2 deletions compiler/test/dotty/tools/vulpix/ParallelTesting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1113,13 +1113,16 @@ trait ParallelTesting extends RunnerOrchestration { self =>
* By default, files are compiled in alphabetical order. An optional seed
* can be used for randomization.
*/
def compileDir(f: String, flags: TestFlags, randomOrder: Option[Int] = None)(implicit testGroup: TestGroup): CompilationTest = {
def compileDir(f: String, flags: TestFlags, randomOrder: Option[Int] = None, recursive: Boolean = true)(implicit testGroup: TestGroup): CompilationTest = {
val outDir = defaultOutputDir + testGroup + "/"
val sourceDir = new JFile(f)
checkRequirements(f, sourceDir, outDir)

def flatten(f: JFile): Array[JFile] =
if (f.isDirectory) f.listFiles.flatMap(flatten)
if (f.isDirectory) {
val files = f.listFiles
if (recursive) files.flatMap(flatten) else files
}
else Array(f)

// Sort files either alphabetically or randomly using the provided seed:
Expand Down