Skip to content

Replace CompilationTest + by aggregateTests #6427

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
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
131 changes: 70 additions & 61 deletions compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class BootstrappedOnlyCompilationTests extends ParallelTesting {
import ParallelTesting._
import TestConfiguration._
import BootstrappedOnlyCompilationTests._
import CompilationTest.aggregateTests

// Test suite configuration --------------------------------------------------

Expand All @@ -31,58 +32,62 @@ class BootstrappedOnlyCompilationTests extends ParallelTesting {

@Test def posMacros: Unit = {
implicit val testGroup: TestGroup = TestGroup("compilePosMacros")
compileFilesInDir("tests/pos-macros", defaultOptions)
}.checkCompile()
compileFilesInDir("tests/pos-macros", defaultOptions).checkCompile()
}

@Test def posWithCompiler: Unit = {
implicit val testGroup: TestGroup = TestGroup("compilePosWithCompiler")
compileFilesInDir("tests/pos-with-compiler", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/ast", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/config", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/core", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/transform", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/parsing", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/printing", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/reporting", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/typer", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/util", withCompilerOptions) +
compileDir("compiler/src/dotty/tools/io", withCompilerOptions)
}.checkCompile()
aggregateTests(
compileFilesInDir("tests/pos-with-compiler", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/ast", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/config", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/core", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/transform", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/parsing", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/printing", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/reporting", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/typer", withCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/util", withCompilerOptions),
compileDir("compiler/src/dotty/tools/io", withCompilerOptions)
).checkCompile()
}

@Test def posTwiceWithCompiler: Unit = {
implicit val testGroup: TestGroup = TestGroup("posTwiceWithCompiler")
compileFile("tests/pos-with-compiler/Labels.scala", withCompilerOptions) +
compileFile("tests/pos-with-compiler/Patterns.scala", withCompilerOptions) +
compileList(
"testNonCyclic",
List(
"compiler/src/dotty/tools/dotc/CompilationUnit.scala",
"compiler/src/dotty/tools/dotc/core/Types.scala",
"compiler/src/dotty/tools/dotc/ast/Trees.scala"
),
withCompilerOptions
) +
compileList(
"testIssue34",
List(
"compiler/src/dotty/tools/dotc/config/Properties.scala",
"compiler/src/dotty/tools/dotc/config/PathResolver.scala"
aggregateTests(
compileFile("tests/pos-with-compiler/Labels.scala", withCompilerOptions),
compileFile("tests/pos-with-compiler/Patterns.scala", withCompilerOptions),
compileList(
"testNonCyclic",
List(
"compiler/src/dotty/tools/dotc/CompilationUnit.scala",
"compiler/src/dotty/tools/dotc/core/Types.scala",
"compiler/src/dotty/tools/dotc/ast/Trees.scala"
),
withCompilerOptions
),
withCompilerOptions
)
}.times(2).checkCompile()
compileList(
"testIssue34",
List(
"compiler/src/dotty/tools/dotc/config/Properties.scala",
"compiler/src/dotty/tools/dotc/config/PathResolver.scala"
),
withCompilerOptions
)
).times(2).checkCompile()
}

// Negative tests ------------------------------------------------------------

@Test def negMacros: Unit = {
implicit val testGroup: TestGroup = TestGroup("compileNegWithCompiler")
compileFilesInDir("tests/neg-macros", defaultOptions)
}.checkExpectedErrors()
compileFilesInDir("tests/neg-macros", defaultOptions).checkExpectedErrors()
}

@Test def negWithCompiler: Unit = {
implicit val testGroup: TestGroup = TestGroup("compileNegWithCompiler")
compileFilesInDir("tests/neg-with-compiler", withCompilerOptions)
}.checkExpectedErrors()
compileFilesInDir("tests/neg-with-compiler", withCompilerOptions).checkExpectedErrors()
}

// Run tests -----------------------------------------------------------------

Expand All @@ -93,10 +98,12 @@ class BootstrappedOnlyCompilationTests extends ParallelTesting {

@Test def runWithCompiler: Unit = {
implicit val testGroup: TestGroup = TestGroup("runWithCompiler")
compileFilesInDir("tests/run-with-compiler", withCompilerOptions) +
compileDir("tests/run-with-compiler-custom-args/tasty-interpreter", withCompilerOptions) +
compileFile("tests/run-with-compiler-custom-args/staged-streams_1.scala", withCompilerOptions without "-Yno-deep-subtypes")
}.checkRuns()
aggregateTests(
compileFilesInDir("tests/run-with-compiler", withCompilerOptions),
compileDir("tests/run-with-compiler-custom-args/tasty-interpreter", withCompilerOptions),
compileFile("tests/run-with-compiler-custom-args/staged-streams_1.scala", withCompilerOptions without "-Yno-deep-subtypes")
).checkRuns()
}

// Pickling Tests ------------------------------------------------------------
//
Expand All @@ -106,26 +113,28 @@ class BootstrappedOnlyCompilationTests extends ParallelTesting {
@Test def picklingWithCompiler: Unit = {
val jvmBackendFilter = FileFilter.exclude(List("BTypes.scala", "Primitives.scala")) // TODO
implicit val testGroup: TestGroup = TestGroup("testPicklingWithCompiler")
compileDir("compiler/src/dotty/tools", picklingWithCompilerOptions, recursive = false) +
compileDir("compiler/src/dotty/tools/dotc", picklingWithCompilerOptions, recursive = false) +
compileDir("library/src/dotty/runtime", picklingWithCompilerOptions) +
compileFilesInDir("compiler/src/dotty/tools/backend/jvm", picklingWithCompilerOptions, jvmBackendFilter) +
compileDir("compiler/src/dotty/tools/dotc/ast", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/core", picklingWithCompilerOptions, recursive = false) +
compileDir("compiler/src/dotty/tools/dotc/config", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/parsing", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/printing", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/repl", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/rewrites", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/transform", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/typer", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/util", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/io", picklingWithCompilerOptions) +
compileFile("tests/pos/pickleinf.scala", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/core/classfile", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/core/tasty", picklingWithCompilerOptions) +
compileDir("compiler/src/dotty/tools/dotc/core/unpickleScala2", picklingWithCompilerOptions)
}.limitThreads(4).checkCompile()
aggregateTests(
compileDir("compiler/src/dotty/tools", picklingWithCompilerOptions, recursive = false),
compileDir("compiler/src/dotty/tools/dotc", picklingWithCompilerOptions, recursive = false),
compileDir("library/src/dotty/runtime", picklingWithCompilerOptions),
compileFilesInDir("compiler/src/dotty/tools/backend/jvm", picklingWithCompilerOptions, jvmBackendFilter),
compileDir("compiler/src/dotty/tools/dotc/ast", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/core", picklingWithCompilerOptions, recursive = false),
compileDir("compiler/src/dotty/tools/dotc/config", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/parsing", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/printing", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/repl", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/rewrites", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/transform", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/typer", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/util", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/io", picklingWithCompilerOptions),
compileFile("tests/pos/pickleinf.scala", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/core/classfile", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/core/tasty", picklingWithCompilerOptions),
compileDir("compiler/src/dotty/tools/dotc/core/unpickleScala2", picklingWithCompilerOptions)
).limitThreads(4).checkCompile()
}

@Test def testPlugins: Unit = {
val pluginFile = "plugin.properties"
Expand Down
Loading