Permalink
Browse files

Arguments test for new test-interface. Ref #813.

  • Loading branch information...
1 parent 45677de commit 796ce33577d75be3aacd846b0e323a21c861edea @harrah harrah committed Jul 12, 2013
@@ -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")
+}
@@ -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
@@ -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") }
+}

0 comments on commit 796ce33

Please sign in to comment.