summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2013-06-07 15:06:31 -0700
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2013-06-15 00:12:44 -0400
commit25a8e70c134c339be0f436013828cacb4898cbe3 (patch)
treed8a8d8ab23b0dc3efa2cdb0b1d5f63b7f09ef64b /test/junit
parenta54d86b5508630a4815ca7f6ca3d5f05b74b1d9f (diff)
downloadscala-25a8e70c134c339be0f436013828cacb4898cbe3.tar.gz
scala-25a8e70c134c339be0f436013828cacb4898cbe3.tar.bz2
scala-25a8e70c134c339be0f436013828cacb4898cbe3.zip
Add support for JUnit tests
Add `test.junit` ant target that compiles and runs JUnit tests found in `test/junit` directory. Add `scala.tools.nsc.SampleTest` that demonstrates working testing infrastructure.
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/tools/nsc/SampleTest.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/SampleTest.scala b/test/junit/scala/tools/nsc/SampleTest.scala
new file mode 100644
index 0000000000..8e026da1ea
--- /dev/null
+++ b/test/junit/scala/tools/nsc/SampleTest.scala
@@ -0,0 +1,17 @@
+package scala.tools.nsc
+package test
+
+import org.junit.Assert._
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+/** Sample JUnit test that shows that all pieces
+ of JUnit infrastructure work correctly */
+@RunWith(classOf[JUnit4])
+class SampleTest {
+ @Test
+ def testMath: Unit = {
+ assert(2+2 == 4, "you didn't get the math right fellow")
+ }
+}