mirror of https://github.com/sbt/sbt.git
test fixes
This commit is contained in:
parent
babf642dfc
commit
aae8b084ca
|
|
@ -17,12 +17,10 @@ object Flat extends Build
|
||||||
def forConfig(conf: Configuration, name: String) = Project.inConfig(conf)( unpackageSettings(name) )
|
def forConfig(conf: Configuration, name: String) = Project.inConfig(conf)( unpackageSettings(name) )
|
||||||
|
|
||||||
def unpackageSettings(name: String) = Seq(
|
def unpackageSettings(name: String) = Seq(
|
||||||
sourceDirectories := file(name) :: Nil,
|
unmanagedSourceDirectories <<= baseDirectory( base => (base / name) :: Nil ),
|
||||||
resourceDirectories :== sourceDirectories,
|
defaultExcludes in unmanagedResources <<= sourceFilter.identity,
|
||||||
resources <<= (sourceDirectories, sourceFilter, defaultExcludes) map {
|
unmanagedResourceDirectories <<= unmanagedSourceDirectories.identity,
|
||||||
(srcs, filter, excl) => srcs.descendentsExcept(-filter,excl).getFiles.toSeq
|
unpackage <<= (artifactPath in packageSrc, baseDirectory) map { (jar, base) =>
|
||||||
},
|
|
||||||
unpackage <<= (jarPath in packageSrc, baseDirectory) map { (jar, base) =>
|
|
||||||
IO.unzip(jar, base / name)
|
IO.unzip(jar, base / name)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import sbt._
|
||||||
object TestPlugin extends Plugin
|
object TestPlugin extends Plugin
|
||||||
{
|
{
|
||||||
val Check = TaskKey[Unit]("check")
|
val Check = TaskKey[Unit]("check")
|
||||||
def settings = Seq(
|
override def settings = Seq(
|
||||||
Check := assert(JavaTest.X == 9)
|
Check := assert(JavaTest.X == 9)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -6,10 +6,9 @@ object B extends Build
|
||||||
lazy val projects = Seq(root)
|
lazy val projects = Seq(root)
|
||||||
lazy val root =
|
lazy val root =
|
||||||
Project("root", file("."))
|
Project("root", file("."))
|
||||||
.configs( it )
|
.configs( IntegrationTest )
|
||||||
.settings( LibraryDependencies += specs )
|
.settings( libraryDependencies += specs )
|
||||||
.settings( Defaults.itSettings : _*)
|
.settings( Defaults.itSettings : _*)
|
||||||
|
|
||||||
lazy val it = Configurations.IntegrationTest
|
|
||||||
lazy val specs = "org.scala-tools.testing" %% "specs" % "1.6.7.2" % "it,test" intransitive()
|
lazy val specs = "org.scala-tools.testing" %% "specs" % "1.6.7.2" % "it,test" intransitive()
|
||||||
}
|
}
|
||||||
|
|
@ -22,6 +22,7 @@ object Execute
|
||||||
private[sbt] def completed(p: => Unit): Completed = new Completed {
|
private[sbt] def completed(p: => Unit): Completed = new Completed {
|
||||||
def process() { p }
|
def process() { p }
|
||||||
}
|
}
|
||||||
|
def noTriggers[A[_]] = new Triggers[A](Map.empty, Map.empty)
|
||||||
}
|
}
|
||||||
sealed trait Completed {
|
sealed trait Completed {
|
||||||
def process(): Unit
|
def process(): Unit
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ object Task
|
||||||
{
|
{
|
||||||
val (service, shutdown) = CompletionService[Task[_], Completed](maxWorkers)
|
val (service, shutdown) = CompletionService[Task[_], Completed](maxWorkers)
|
||||||
|
|
||||||
val x = new Execute[Task](checkCycles)(taskToNode)
|
val x = new Execute[Task](checkCycles, Execute.noTriggers)(taskToNode)
|
||||||
try { x.run(root)(service) } finally { shutdown() }
|
try { x.run(root)(service) } finally { shutdown() }
|
||||||
}
|
}
|
||||||
def tryRun[T](root: Task[T], checkCycles: Boolean, maxWorkers: Int): T =
|
def tryRun[T](root: Task[T], checkCycles: Boolean, maxWorkers: Int): T =
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ object TaskTest
|
||||||
{
|
{
|
||||||
val (service, shutdown) = CompletionService[Task[_], Completed](maxWorkers)
|
val (service, shutdown) = CompletionService[Task[_], Completed](maxWorkers)
|
||||||
|
|
||||||
val x = new Execute[Task](checkCycles)(taskToNode)
|
val x = new Execute[Task](checkCycles, Execute.noTriggers)(taskToNode)
|
||||||
try { x.run(root)(service) } finally { shutdown() }
|
try { x.run(root)(service) } finally { shutdown() }
|
||||||
}
|
}
|
||||||
def tryRun[T](root: Task[T], checkCycles: Boolean, maxWorkers: Int): T =
|
def tryRun[T](root: Task[T], checkCycles: Boolean, maxWorkers: Int): T =
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ object ParserExample
|
||||||
val ann = aqn ~ an
|
val ann = aqn ~ an
|
||||||
|
|
||||||
def r = apply(ann)("a"*(n*2)).resultEmpty
|
def r = apply(ann)("a"*(n*2)).resultEmpty
|
||||||
println(r.isDefined)
|
println(r.isValid)
|
||||||
}
|
}
|
||||||
def run2(n: Int)
|
def run2(n: Int)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue