From 25a8e70c134c339be0f436013828cacb4898cbe3 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Fri, 7 Jun 2013 15:06:31 -0700 Subject: 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. --- test/junit/scala/tools/nsc/SampleTest.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/junit/scala/tools/nsc/SampleTest.scala (limited to 'test/junit') 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") + } +} -- cgit v1.2.3