Skip to content

Cleanup tests #3926

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 24 commits into from
Feb 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9799018
Combine tests from /neg-with-implicits into /neg
OlivierBlanvillain Jan 25, 2018
d27f9a6
Fix "\n " pattern in all error messages
OlivierBlanvillain Jan 24, 2018
abc8e31
Add all passing pending & untried tests
OlivierBlanvillain Jan 26, 2018
8cd6050
Fix pending/run/{Meter,MeterCaseClass} tests
OlivierBlanvillain Jan 25, 2018
70766ba
Fix pending/run/literals test
OlivierBlanvillain Jan 25, 2018
1a80d78
Remove warnings from pending tests
OlivierBlanvillain Jan 26, 2018
cbe2291
Fix t4047.scala
OlivierBlanvillain Jan 26, 2018
cd09060
Strip "../" from test output
OlivierBlanvillain Sep 19, 2017
8c706c4
Disable Partest, s.reflect & existential tests
OlivierBlanvillain Jan 25, 2018
f333cfb
Clean up all orphan .check and .flags files
OlivierBlanvillain Jan 26, 2018
1d4a093
Update tests blacklists in FromTastyTests.scala
OlivierBlanvillain Jan 26, 2018
f9ef6b6
Fix vulpix to fail on error free neg tests
OlivierBlanvillain Jan 29, 2018
1d3480f
Remove flags
OlivierBlanvillain Jan 30, 2018
cc1f9ba
Remove duplicate test
OlivierBlanvillain Jan 26, 2018
895af78
Remove test that fails bootstrapped
OlivierBlanvillain Jan 30, 2018
58ee725
Removes tests that fail under legacy
OlivierBlanvillain Jan 29, 2018
0851931
Address review
OlivierBlanvillain Jan 31, 2018
6ab970d
Revert "Strip "../" from test output"
OlivierBlanvillain Jan 31, 2018
58b55fa
Set baseDirectory to ".." in tests
OlivierBlanvillain Jan 31, 2018
a24ccf3
Remove . from test classpath
OlivierBlanvillain Feb 1, 2018
d2a590a
Revert/fix warnings changes on pending/run tests
OlivierBlanvillain Feb 1, 2018
133b8ff
Factor out fatal-warnings & double-bindings tests
OlivierBlanvillain Feb 1, 2018
a7592b2
Merge branch 'master' into cleanup-tests
OlivierBlanvillain Feb 5, 2018
8547e85
Open #3963
OlivierBlanvillain Feb 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/CheckRealizable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object CheckRealizable {
extends Realizability(i" has conflicting base types $base1 and $base2")

class HasProblemField(fld: SingleDenotation, problem: Realizability)(implicit ctx: Context)
extends Realizability(i" has a member $fld which is not a legal path\n since ${fld.symbol.name}: ${fld.info}${problem.msg}")
extends Realizability(i" has a member $fld which is not a legal path\nsince ${fld.symbol.name}: ${fld.info}${problem.msg}")

class ProblemInUnderlying(tp: Type, problem: Realizability)(implicit ctx: Context)
extends Realizability(i"s underlying type ${tp}${problem.msg}") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ trait ConstraintHandling {
typr.println(s"approx ${param.show}, from below = $fromBelow, bound = ${bound.show}, inst = ${inst.show}")
inst
case inst =>
assert(inst.exists, i"param = $param\n constraint = $constraint")
assert(inst.exists, i"param = $param\nconstraint = $constraint")
inst
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ trait SymDenotations { this: Context =>
}
denot match {
case denot: SymDenotation =>
def explainSym(msg: String) = explain(s"$msg\n defined = ${denot.definedPeriodsString}")
def explainSym(msg: String) = explain(s"$msg\ndefined = ${denot.definedPeriodsString}")
if (denot.is(ValidForever) || denot.isRefinementClass) true
else {
implicit val ctx = this
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ abstract class SymbolLoader extends LazyType {
val msg = ex.getMessage()
ctx.error(
if (msg eq null) "i/o error while loading " + root.name
else "error while loading " + root.name + ",\n " + msg)
else "error while loading " + root.name + ",\n" + msg)
}
try {
val start = currentTime
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/LazyVals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
ref(initSymbol).ensureApplied).ensureConforms(tpe)

val methodTree = DefDef(x.symbol.asTerm, methodBody)
ctx.debuglog(s"found a lazy val ${x.show},\n rewrote with ${holderTree.show}")
ctx.debuglog(s"found a lazy val ${x.show},\nrewrote with ${holderTree.show}")
Thicket(holderTree, initTree, methodTree)
}

Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ object Applications {
def fail = {
val addendum =
if (ctx.scala2Mode && unapplyName == nme.unapplySeq)
"\n You might want to try to rewrite the extractor to use `unapply` instead."
"\nYou might want to try to rewrite the extractor to use `unapply` instead."
ctx.error(em"$unapplyResult is not a valid result type of an $unapplyName method of an extractor$addendum", pos)
Nil
}
Expand Down Expand Up @@ -785,7 +785,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>

/** Overridden in ReTyper to handle primitive operations that can be generated after erasure */
protected def handleUnexpectedFunType(tree: untpd.Apply, fun: Tree)(implicit ctx: Context): Tree =
throw new Error(i"unexpected type.\n fun = $fun,\n methPart(fun) = ${methPart(fun)},\n methPart(fun).tpe = ${methPart(fun).tpe},\n tpe = ${fun.tpe}")
throw new Error(i"unexpected type.\n fun = $fun,\n methPart(fun) = ${methPart(fun)},\n methPart(fun).tpe = ${methPart(fun).tpe},\n tpe = ${fun.tpe}")

def typedNamedArgs(args: List[untpd.Tree])(implicit ctx: Context) =
for (arg @ NamedArg(id, argtpt) <- args) yield {
Expand Down Expand Up @@ -971,7 +971,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
args.init :+ argSeq
case _ =>
val (regularArgs, varArgs) = args.splitAt(argTypes.length - 1)
regularArgs :+ untpd.SeqLiteral(varArgs, untpd.TypeTree())
regularArgs :+ untpd.SeqLiteral(varArgs, untpd.TypeTree()).withPos(tree.pos)
}
else if (argTypes.lengthCompare(1) == 0 && args.lengthCompare(1) > 0 && ctx.canAutoTuple)
untpd.Tuple(args) :: Nil
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ object Checking {
def checkRealizable(tp: Type, pos: Position)(implicit ctx: Context): Unit = {
val rstatus = realizability(tp)
if (rstatus ne Realizable)
ctx.errorOrMigrationWarning(em"$tp is not a legal path\n since it${rstatus.msg}", pos)
ctx.errorOrMigrationWarning(em"$tp is not a legal path\nsince it${rstatus.msg}", pos)
}

/** A type map which checks that the only cycles in a type are F-bounds
Expand Down Expand Up @@ -434,7 +434,7 @@ object Checking {
var tp1 =
if (isLeaked(tp.symbol)) {
errors =
(() => em"non-private $sym refers to private ${tp.symbol}\n in its type signature ${sym.info}") :: errors
(() => em"non-private $sym refers to private ${tp.symbol}\nin its type signature ${sym.info}") :: errors
tp
}
else mapOver(tp)
Expand Down Expand Up @@ -623,7 +623,7 @@ trait Checking {
def ofType = if (decl.isType) "" else em": ${other.info}"
def explanation =
if (!decl.isRealMethod) ""
else "\n (the definitions have matching type signatures)"
else "\n(the definitions have matching type signatures)"
ctx.error(em"$decl is already defined as $other$ofType$explanation", decl.pos)
}
if (decl is Synthetic) doubleDefError(other, decl)
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ object ErrorReporting {
val found1 = dropJavaMethod(found)
val expected1 = dropJavaMethod(expected)
if ((found1 eq found) != (expected eq expected1) && (found1 <:< expected1))
"\n (Note that Scala's and Java's representation of this type differs)"
"\n(Note that Scala's and Java's representation of this type differs)"
else if (found.topType != expected.topType)
"\n (Note that the types are in different universes, see Phantom types)"
"\n(Note that the types are in different universes, see Phantom types)"
else if (ctx.settings.explainTypes.value)
"\n" + ctx.typerState.show + "\n" + TypeComparer.explained((found <:< expected)(_))
else
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ object Implicits {
em"both ${err.refStr(alt1.ref)} and ${err.refStr(alt2.ref)} $qualify"
override def whyNoConversion(implicit ctx: Context) =
"\nNote that implicit conversions cannot be applied because they are ambiguous;" +
"\n " + explanation
"\n" + explanation
}

class MismatchedImplicit(ref: TermRef,
Expand Down Expand Up @@ -788,7 +788,7 @@ trait Implicits { self: Typer =>
inferImplicit(pt, argument, pos)(ctx.addMode(Mode.OldOverloadingResolution)) match {
case altResult: SearchSuccess =>
ctx.migrationWarning(
s"According to new implicit resolution rules, this will be ambiguous:\n ${result.reason.explanation}",
s"According to new implicit resolution rules, this will be ambiguous:\n${result.reason.explanation}",
pos)
altResult
case _ =>
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/typer/RefChecks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ object RefChecks {
.filter(_.name != member.name)
.map(_.show).distinct
if (others1.isEmpty) ""
else i";\n other members with override errors are:: $others1%, %"
else i";\nother members with override errors are:: $others1%, %"
}
ctx.error(msg + othersMsg, clazz.pos)
}
Expand Down Expand Up @@ -216,14 +216,14 @@ object RefChecks {
(other.owner isSubClass member.owner) && other.is(Deferred) && !member.is(Deferred)
val addendum =
if (isConcreteOverAbstract)
";\n (Note that %s is abstract,\n and is therefore overridden by concrete %s)".format(
";\n (Note that %s is abstract,\n and is therefore overridden by concrete %s)".format(
infoStringWithLocation(other),
infoStringWithLocation(member))
else if (ctx.settings.Ydebug.value)
err.typeMismatchMsg(memberTp(self), otherTp(self))
else ""

"error overriding %s;\n %s %s%s".format(
"error overriding %s;\n %s %s%s".format(
infoStringWithLocation(other), infoString(member), msg, addendum)
}

Expand Down
39 changes: 20 additions & 19 deletions compiler/test/dotc/tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class tests extends CompilerTest {
// tests that match regex '(pos|dotc|run|java|compileStdLib)\.*' would be
// executed as benchmarks.

val defaultOutputDir = "../out/"
val defaultOutputDir = "out/"

val noCheckOptions = List(
// "-verbose",
Expand Down Expand Up @@ -85,7 +85,7 @@ class tests extends CompilerTest {
val explicitUTF8 = List("-encoding", "UTF8")
val explicitUTF16 = List("-encoding", "UTF16")

val testsDir = "../tests/"
val testsDir = "tests/"
val posDir = testsDir + "pos/"
val posSpecialDir = testsDir + "pos-special/"
val posScala2Dir = testsDir + "pos-scala2/"
Expand All @@ -94,7 +94,7 @@ class tests extends CompilerTest {
val newDir = testsDir + "new/"
val javaDir = testsDir + "pos-java-interop/"

val sourceDir = "./src/"
val sourceDir = "compiler/src/"
val dottyDir = sourceDir + "dotty/"
val toolsDir = dottyDir + "tools/"
val backendDir = toolsDir + "backend/"
Expand All @@ -103,7 +103,7 @@ class tests extends CompilerTest {
val parsingDir = dotcDir + "parsing/"
val dottyReplDir = dotcDir + "repl/"
val typerDir = dotcDir + "typer/"
val libDir = "../library/src/"
val libDir = "library/src/"

def dottyBootedLib = compileDir(libDir, ".", List("-deep", "-Ycheck-reentrant", "-strict"))(allowDeepSubtypes) // note the -deep argument
def dottyDependsOnBootedLib = compileDir(dottyDir, ".", List("-deep", "-Ycheck-reentrant"))(allowDeepSubtypes) // note the -deep argument
Expand Down Expand Up @@ -187,13 +187,14 @@ class tests extends CompilerTest {
@Test def negVarargsT1625 = compileFiles(negDir + "varargsInMethodsT1625/")

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

@Test def neg_typers() = compileFile(negCustomArgs, "typers")(allowDoubleBindings)
@Test def neg_typers() = compileFile(negAllowDoubleBindings, "typers")(allowDoubleBindings)
@Test def neg_overrideClass = compileFile(negCustomArgs, "overrideClass", scala2mode)
@Test def neg_autoTupling = compileFile(negCustomArgs, "autoTuplingTest", args = "-language:noAutoTupling" :: Nil)
@Test def neg_i1050 = compileFile(negCustomArgs, "i1050", List("-strict"))
@Test def neg_i1240 = compileFile(negCustomArgs, "i1240")(allowDoubleBindings)
@Test def neg_i2002 = compileFile(negCustomArgs, "i2002")(allowDoubleBindings)
@Test def neg_i1240 = compileFile(negAllowDoubleBindings, "i1240")(allowDoubleBindings)
@Test def neg_i2002 = compileFile(negAllowDoubleBindings, "i2002")(allowDoubleBindings)
@Test def neg_valueclasses_doubledefs = compileFile(negCustomArgs, "valueclasses-doubledefs")(allowDoubleBindings)
@Test def neg_valueclasses_pavlov = compileFile(negCustomArgs, "valueclasses-pavlov")(allowDoubleBindings)
@Test def neg_trailingUnderscore = compileFile(negCustomArgs, "trailingUnderscore", args = "-strict" :: Nil)
Expand All @@ -218,19 +219,19 @@ class tests extends CompilerTest {
compileList("compileStdLib", stdlibFiles, "-migration" :: "-Yno-inline" :: scala2mode)

@Test def compileMixed = compileLine(
"""../tests/pos/B.scala
|../scala2-library/src/library/scala/collection/immutable/Seq.scala
|../scala2-library/src/library/scala/collection/parallel/ParSeq.scala
|../scala2-library/src/library/scala/package.scala
|../scala2-library/src/library/scala/collection/GenSeqLike.scala
|../scala2-library/src/library/scala/collection/SeqLike.scala
|../scala2-library/src/library/scala/collection/generic/GenSeqFactory.scala""".stripMargin)(scala2mode ++ defaultOptions)
@Test def compileIndexedSeq = compileLine("../scala2-library/src/library/scala/collection/immutable/IndexedSeq.scala")
@Test def compileParSetLike = compileLine("../scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala")
"""tests/pos/B.scala
|scala2-library/src/library/scala/collection/immutable/Seq.scala
|scala2-library/src/library/scala/collection/parallel/ParSeq.scala
|scala2-library/src/library/scala/package.scala
|scala2-library/src/library/scala/collection/GenSeqLike.scala
|scala2-library/src/library/scala/collection/SeqLike.scala
|scala2-library/src/library/scala/collection/generic/GenSeqFactory.scala""".stripMargin)(scala2mode ++ defaultOptions)
@Test def compileIndexedSeq = compileLine("scala2-library/src/library/scala/collection/immutable/IndexedSeq.scala")
@Test def compileParSetLike = compileLine("scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala")
@Test def compileParSetSubset = compileLine(
"""../scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala
|../scala2-library/src/library/scala/collection/parallel/mutable/ParSet.scala
|../scala2-library/src/library/scala/collection/mutable/SetLike.scala""".stripMargin)(scala2mode ++ defaultOptions)
"""scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala
|scala2-library/src/library/scala/collection/parallel/mutable/ParSet.scala
|scala2-library/src/library/scala/collection/mutable/SetLike.scala""".stripMargin)(scala2mode ++ defaultOptions)

@Test def dottyBooted = {
dottyBootedLib
Expand Down
6 changes: 3 additions & 3 deletions compiler/test/dotty/tools/StdLibSources.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ object StdLibSources {
/* For debug only */
private val useExplicitWhiteList = false

private final val stdLibPath = "../scala2-library/src/library/"
private final val stdLibPath = "scala2-library/src/library/"

def blacklistFile: String = "../compiler/test/dotc/scala-collections.blacklist"
private def whitelistFile: String = "../compiler/test/dotc/scala-collections.whitelist"
def blacklistFile: String = "compiler/test/dotc/scala-collections.blacklist"
private def whitelistFile: String = "compiler/test/dotc/scala-collections.whitelist"

def whitelisted: List[String] = {
lazy val whitelistBasedOnBlacklist = all.diff(blacklisted)
Expand Down
Loading