mirror of https://github.com/sbt/sbt.git
test-quick test.
This commit is contained in:
parent
1687cf8a8c
commit
d81f2b5870
|
|
@ -0,0 +1,4 @@
|
|||
case class A(b: B) {
|
||||
def foo = b.foo
|
||||
// A comment added should trigger recompilation.
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class B {
|
||||
def foo = 1
|
||||
// API-level change
|
||||
def bar(a: A) = 2
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import java.io.File
|
||||
|
||||
trait Base {
|
||||
val marker = new File("marker")
|
||||
// Test compilation group change.
|
||||
val baz = ""
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
import Defaults._
|
||||
|
||||
object B extends Build {
|
||||
lazy val root = Project("root", file("."), settings = defaultSettings ++ Seq(
|
||||
libraryDependencies += "org.scalatest" % "scalatest_2.9.0" % "1.6.1" % "test",
|
||||
parallelExecution in test := false
|
||||
))
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
// A, B are referring to each other, OK in the same compilation group.
|
||||
case class A(b: B) {
|
||||
def foo = b.foo
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
class B {
|
||||
def foo = 1
|
||||
def bar(a: A) {}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import java.io.File
|
||||
|
||||
trait Base {
|
||||
val marker = new File("marker")
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import org.scalatest.FlatSpec
|
||||
import org.scalatest.matchers.ShouldMatchers
|
||||
|
||||
class Create extends FlatSpec with ShouldMatchers with Base {
|
||||
"a file" should "not exist" in {
|
||||
A(new B).foo
|
||||
marker.exists should equal(false)
|
||||
marker.createNewFile() should equal (true)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import org.scalatest.FlatSpec
|
||||
import org.scalatest.matchers.ShouldMatchers
|
||||
|
||||
class Delete extends FlatSpec with ShouldMatchers with Base {
|
||||
"a file" should "exist" in {
|
||||
marker.exists should equal(true)
|
||||
marker.delete()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
> test-quick Create
|
||||
# Create not re-run, Delete deletes the file.
|
||||
> test-quick
|
||||
# Re-create the file.
|
||||
> test-only Create
|
||||
|
||||
# Non-API change
|
||||
$ copy-file changed/A.scala src/main/scala/A.scala
|
||||
> compile
|
||||
$ sleep 2000
|
||||
# Create is run. Delete is not since it doesn't have src/main dependency.
|
||||
-> test-quick
|
||||
> test-only Delete
|
||||
# Previous run of Create failed, re-run.
|
||||
> test-quick Create
|
||||
# No-op.
|
||||
> test-quick Create
|
||||
# API change.
|
||||
|
||||
$ copy-file changed/B.scala src/main/scala/B.scala
|
||||
> compile
|
||||
$ sleep 2000
|
||||
-> test-quick Create
|
||||
> test-only Delete
|
||||
# Previous run of Create failed, re-run.
|
||||
> test-quick Create
|
||||
# src/test compilation group change.
|
||||
|
||||
$ copy-file changed/Base.scala src/test/scala/Base.scala
|
||||
> test:compile
|
||||
$ sleep 2000
|
||||
-> test-quick Create
|
||||
> test-quick Delete
|
||||
> test-quick Create
|
||||
Loading…
Reference in New Issue