Skip to content

Commit fb23c17

Browse files
committed
TestsPlugin: Introduce App/App2/testRunApp
1 parent f611549 commit fb23c17

File tree

160 files changed

+932
-67
lines changed

Some content is hidden

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

160 files changed

+932
-67
lines changed

functional-tests/src/main/scala/com/typesafe/tools/mima/lib/CollectProblemsTest.scala

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import scala.tools.nsc.classpath.AggregateClassPath
1111
object CollectProblemsTest {
1212

1313
// Called via reflection from TestsPlugin
14-
def runTest(testClasspath: Array[File], testName: String, oldJarOrDir: File, newJarOrDir: File, baseDir: File, scalaVersion: String): Unit = {
14+
def runTest(testClasspath: Array[File], testName: String, oldJarOrDir: File, newJarOrDir: File, baseDir: File, oracleFile: File): Unit = {
1515
val testClassPath = aggregateClassPath(testClasspath)
1616
val classpath = AggregateClassPath.createAggregate(testClassPath, Config.baseClassPath)
1717
val mima = new MiMaLib(classpath)
@@ -25,16 +25,6 @@ object CollectProblemsTest {
2525
val problems = mima.collectProblems(oldJarOrDir, newJarOrDir).filter(problemFilter)
2626

2727
// load oracle
28-
val oracleFile = {
29-
val p = new File(baseDir, "problems.txt")
30-
val p211 = new File(baseDir, "problems-2.11.txt")
31-
val p212 = new File(baseDir, "problems-2.12.txt")
32-
scalaVersion.take(4) match {
33-
case "2.11" => if (p211.exists()) p211 else if (p212.exists()) p212 else p
34-
case "2.12" => if (p212.exists()) p212 else p
35-
case _ => p
36-
}
37-
}
3828
val source = Source.fromFile(oracleFile)
3929
val expectedProblems = try source.getLines.filter(!_.startsWith("#")).toList finally source.close()
4030

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object App {
2+
def main(args: Array[String]): Unit = {
3+
println(Usage.use(new A {}))
4+
}
5+
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
abstract class A
1+
abstract class A
2+
3+
object Usage {
4+
def use(a: A) = ()
5+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
abstract class A {
22
def foo(): Unit
33
}
4+
5+
object Usage {
6+
def use(a: A) = a.foo()
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
object App {
2+
def main(args: Array[String]): Unit = {
3+
println(new A {}.foo(new A {}))
4+
println(new C)
5+
println(new D)
6+
7+
println(new E { def bar(): E = new E { def bar() = this } }.bar())
8+
println(new F)
9+
}
10+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object App {
2+
def main(args: Array[String]): Unit = {
3+
println(new A {}.foo(new A {}))
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object App {
2+
def main(args: Array[String]): Unit = {
3+
println(new A { def foo = () }.foo)
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object App {
2+
def main(args: Array[String]): Unit = {
3+
println(new A {}.foo(new A {}))
4+
}
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object App {
2+
def main(args: Array[String]): Unit = {
3+
println(Usage.use(new A {}))
4+
println(Usage.use(new B {}))
5+
}
6+
}

functional-tests/src/test/abstract-class-inherits-new-abstract-class-with-abstract-method-nok/v1/A.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ abstract class C extends B {
55
}
66
abstract class D extends C
77

8+
object Usage {
9+
def use(a: A) = ()
10+
}

0 commit comments

Comments
 (0)