mirror of https://github.com/sbt/sbt.git
preserve compatibility for TestCleanup and TestSetup
This commit is contained in:
parent
ccb5141ae0
commit
c87fae4465
|
|
@ -69,11 +69,13 @@ trait ScalaProject extends SimpleScalaProject with FileTasks with MultiTaskProje
|
|||
trait PackageOption extends ActionOption
|
||||
trait TestOption extends ActionOption
|
||||
|
||||
case class TestSetup(setup: ClassLoader => Unit) extends TestOption {
|
||||
def this(setup: () => Unit) = this(_ => setup())
|
||||
final case class TestSetup(setup: ClassLoader => Unit) extends TestOption
|
||||
object TestSetup {
|
||||
def apply(setup: () => Unit) = new TestSetup(_ => setup())
|
||||
}
|
||||
case class TestCleanup(cleanup: ClassLoader => Unit) extends TestOption {
|
||||
def this(setup: () => Unit) = this(_ => setup())
|
||||
final case class TestCleanup(cleanup: ClassLoader => Unit) extends TestOption
|
||||
object TestCleanup {
|
||||
def apply(setup: () => Unit) = new TestCleanup(_ => setup())
|
||||
}
|
||||
case class ExcludeTests(tests: Iterable[String]) extends TestOption
|
||||
case class TestListeners(listeners: Iterable[TestReportListener]) extends TestOption
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ object TestFramework
|
|||
|
||||
val mappedTests = testMap(arguments.keys.toList, tests, arguments)
|
||||
if(mappedTests.isEmpty)
|
||||
(new NamedTestTask(TestStartName, None) :: Nil, Nil, new NamedTestTask(TestFinishName, { log.info("No tests to run."); cleanTmp() }) :: Nil )
|
||||
(new NamedTestTask(TestStartName, None) :: Nil, Nil, new NamedTestTask(TestFinishName, { log.info("No tests to run."); cleanTmp(loader) }) :: Nil )
|
||||
else
|
||||
createTestTasks(loader, mappedTests, log, listeners, endErrorsEnabled, setup, Seq(cleanTmp) ++ cleanup)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue