Files
sbt/scripted/base/StatementHandler.scala
T
Mark Harrah c4419140aa brought minimal scripted test framework back
updated source dependendency tests
will need to restore cross building
2010-09-27 18:39:14 -04:00

27 lines
710 B
Scala

/* sbt -- Simple Build Tool
* Copyright 2009 Mark Harrah
*/
package xsbt.test
trait StatementHandler
{
type State
def initialState: State
def apply(command: String, arguments: List[String], state: State): State
def finish(state: State): Unit
}
trait BasicStatementHandler extends StatementHandler
{
final type State = Unit
final def initialState = ()
final def apply(command: String, arguments: List[String], state: Unit): Unit= apply(command, arguments)
def apply(command: String, arguments: List[String]): Unit
def finish(state: Unit) = ()
}
/** Use when a stack trace is not useful */
final class TestFailed(msg: String) extends RuntimeException(msg)
{
override def fillInStackTrace = this
}