Skip to content

Commit 133b8ff

Browse files
Factor out fatal-warnings & double-bindings tests
1 parent d2a590a commit 133b8ff

15 files changed

+8
-18
lines changed

compiler/test/dotc/tests.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,14 @@ class tests extends CompilerTest {
187187
@Test def negVarargsT1625 = compileFiles(negDir + "varargsInMethodsT1625/")
188188

189189
val negCustomArgs = testsDir + "neg-custom-args/"
190+
val negAllowDoubleBindings = negCustomArgs + "allow-double-bindings/"
190191

191-
@Test def neg_typers() = compileFile(negCustomArgs, "typers")(allowDoubleBindings)
192+
@Test def neg_typers() = compileFile(negAllowDoubleBindings, "typers")(allowDoubleBindings)
192193
@Test def neg_overrideClass = compileFile(negCustomArgs, "overrideClass", scala2mode)
193194
@Test def neg_autoTupling = compileFile(negCustomArgs, "autoTuplingTest", args = "-language:noAutoTupling" :: Nil)
194195
@Test def neg_i1050 = compileFile(negCustomArgs, "i1050", List("-strict"))
195-
@Test def neg_i1240 = compileFile(negCustomArgs, "i1240")(allowDoubleBindings)
196-
@Test def neg_i2002 = compileFile(negCustomArgs, "i2002")(allowDoubleBindings)
196+
@Test def neg_i1240 = compileFile(negAllowDoubleBindings, "i1240")(allowDoubleBindings)
197+
@Test def neg_i2002 = compileFile(negAllowDoubleBindings, "i2002")(allowDoubleBindings)
197198
@Test def neg_valueclasses_doubledefs = compileFile(negCustomArgs, "valueclasses-doubledefs")(allowDoubleBindings)
198199
@Test def neg_valueclasses_pavlov = compileFile(negCustomArgs, "valueclasses-pavlov")(allowDoubleBindings)
199200
@Test def neg_trailingUnderscore = compileFile(negCustomArgs, "trailingUnderscore", args = "-strict" :: Nil)

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class CompilationTests extends ParallelTesting {
105105
compileDir("tests/pos/i1137-1", defaultOptions and "-Yemit-tasty") +
106106
compileFile(
107107
// succeeds despite -Xfatal-warnings because of -nowarn
108-
"tests/neg-custom-args/xfatalWarnings.scala",
108+
"tests/neg-custom-args/fatal-warnings/xfatalWarnings.scala",
109109
defaultOptions.and("-nowarn", "-Xfatal-warnings")
110110
)
111111
}.checkCompile()
@@ -175,27 +175,16 @@ class CompilationTests extends ParallelTesting {
175175
compileFilesInDir("tests/neg", defaultOptions) +
176176
compileFilesInDir("tests/neg-tailcall", defaultOptions) +
177177
compileFilesInDir("tests/neg-no-optimise", defaultOptions) +
178+
compileFilesInDir("tests/neg-custom-args/fatal-warnings", defaultOptions.and("-Xfatal-warnings")) +
179+
compileFilesInDir("tests/neg-custom-args/allow-double-bindings", allowDoubleBindings) +
178180
compileFile("tests/neg-custom-args/i3246.scala", scala2Mode) +
179-
compileFile("tests/neg-custom-args/typers.scala", allowDoubleBindings) +
180181
compileFile("tests/neg-custom-args/overrideClass.scala", scala2Mode) +
181182
compileFile("tests/neg-custom-args/autoTuplingTest.scala", defaultOptions.and("-language:noAutoTupling")) +
182183
compileFile("tests/neg-custom-args/i1050.scala", defaultOptions.and("-strict")) +
183-
compileFile("tests/neg-custom-args/i1240.scala", allowDoubleBindings) +
184-
compileFile("tests/neg-custom-args/i2002.scala", allowDoubleBindings) +
185184
compileFile("tests/neg-custom-args/nopredef.scala", defaultOptions.and("-Yno-predef")) +
186185
compileFile("tests/neg-custom-args/noimports.scala", defaultOptions.and("-Yno-imports")) +
187186
compileFile("tests/neg-custom-args/noimports2.scala", defaultOptions.and("-Yno-imports")) +
188-
compileFile("tests/neg-custom-args/overloadsOnAbstractTypes.scala", allowDoubleBindings) +
189-
compileFile("tests/neg-custom-args/xfatalWarnings.scala", defaultOptions.and("-Xfatal-warnings")) +
190-
compileFile("tests/neg-custom-args/i3561.scala", defaultOptions.and("-Xfatal-warnings")) +
191-
compileFile("tests/neg-custom-args/pureStatement.scala", defaultOptions.and("-Xfatal-warnings")) +
192-
compileFile("tests/neg-custom-args/i2333.scala", defaultOptions.and("-Xfatal-warnings")) +
193-
compileFile("tests/neg-custom-args/i3882.scala", allowDeepSubtypes) +
194-
compileFile("tests/neg-custom-args/phantom-overload.scala", allowDoubleBindings) +
195-
compileFile("tests/neg-custom-args/phantom-overload-2.scala", allowDoubleBindings) +
196-
compileFile("tests/neg-custom-args/structural.scala", defaultOptions.and("-Xfatal-warnings")) +
197-
compileFile("tests/neg-custom-args/i2673.scala", defaultOptions.and("-Xfatal-warnings")) +
198-
compileFile("tests/neg-custom-args/t3235-minimal.scala", defaultOptions.and("-Xfatal-warnings"))
187+
compileFile("tests/neg-custom-args/i3882.scala", allowDeepSubtypes)
199188
}.checkExpectedErrors()
200189

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

0 commit comments

Comments
 (0)