Skip to content

Instantly share code, notes, and snippets.

@takezoe
Created May 19, 2012 04:27
Show Gist options
  • Save takezoe/2729103 to your computer and use it in GitHub Desktop.
Save takezoe/2729103 to your computer and use it in GitHub Desktop.
An example which runs ScalaTest by program
import org.scalatest._
import org.scalatest.events._
/**
* An example which runs ScalaTest by program.
*/
object RunScalaTest extends App {
// MySuite is a testsuite
new MySuite().run(None, new Reporter {
def apply(event: Event) = event match {
case e: TestStarting => print(e.testName + " ... ")
case e: TestSucceeded => println("succeeded.")
case e: TestFailed => println("failed."); println(e.message)
case e: TestPending => println("pending.")
case e: TestIgnored => println("ignored.")
case _ =>
}
}, new Stopper {}, Filter(), Map[String, Any](), None, new Tracker())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment