From 796ce33577d75be3aacd846b0e323a21c861edea Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Thu, 11 Jul 2013 22:54:42 -0400 Subject: [PATCH] Arguments test for new test-interface. Ref #813. --- .../sbt-test/tests/arguments-new/build.sbt | 13 ++++++++++ sbt/src/sbt-test/tests/arguments-new/pending | 26 +++++++++++++++++++ .../src/test/scala/ArgumentTest.scala | 14 ++++++++++ 3 files changed, 53 insertions(+) create mode 100644 sbt/src/sbt-test/tests/arguments-new/build.sbt create mode 100644 sbt/src/sbt-test/tests/arguments-new/pending create mode 100644 sbt/src/sbt-test/tests/arguments-new/src/test/scala/ArgumentTest.scala diff --git a/sbt/src/sbt-test/tests/arguments-new/build.sbt b/sbt/src/sbt-test/tests/arguments-new/build.sbt new file mode 100644 index 000000000..a477091b7 --- /dev/null +++ b/sbt/src/sbt-test/tests/arguments-new/build.sbt @@ -0,0 +1,13 @@ +libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0.M6-SNAP26" % "test" + + +testOptions in Configurations.Test ++= { + def args(path: String, args: String*): Seq[TestOption] = if(file(path).exists) Tests.Argument(args : _*) :: Nil else Nil +// + args("success1", "-n", "test2 test3") ++ + args("success2", "-n", "test2") ++ + args("success3", "-n", "test3") ++ + args("failure1", "-n", "test1") ++ + args("failure2", "-n", "test1 test4") ++ + args("failure3", "-n", "test1 test3") +} \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/arguments-new/pending b/sbt/src/sbt-test/tests/arguments-new/pending new file mode 100644 index 000000000..c410396aa --- /dev/null +++ b/sbt/src/sbt-test/tests/arguments-new/pending @@ -0,0 +1,26 @@ +# should fail because it should run all test:tests, some of which are expected to fail (1 and 4) +-> test:test + +$ touch success1 +> test:test +$ delete success1 + +$ touch failure1 +-> test:test +$ delete failure1 + +$ touch success2 +> test:test +$ delete success2 + +$ touch failure2 +-> test:test +$ delete failure2 + +$ touch success3 +> test:test +$ delete success3 + +$ touch failure3 +-> test:test +$ delete failure3 \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/arguments-new/src/test/scala/ArgumentTest.scala b/sbt/src/sbt-test/tests/arguments-new/src/test/scala/ArgumentTest.scala new file mode 100644 index 000000000..c9c67dbef --- /dev/null +++ b/sbt/src/sbt-test/tests/arguments-new/src/test/scala/ArgumentTest.scala @@ -0,0 +1,14 @@ + +import org.scalatest.fixture.FunSuite +import org.scalatest.Tag + +class ArgumentTest extends FunSuite{ + type FixtureParam = Map[String,Any] + override def withFixture(test: OneArgTest) = { + test(test.configMap) + } + test("1", Tag("test1")){ conf => error("error #1") } + test("2", Tag("test2")){ conf => () } + test("3", Tag("test3")){ conf => () } + test("4", Tag("test4")){ conf => error("error #4") } +} \ No newline at end of file