2009-11-09 15:34:52 +01:00
|
|
|
package xsbt.test
|
|
|
|
|
|
|
|
|
|
trait StatementHandler
|
|
|
|
|
{
|
|
|
|
|
type State
|
|
|
|
|
def initialState: State
|
|
|
|
|
def apply(command: String, arguments: List[String], state: State): State
|
2009-12-05 03:31:03 +01:00
|
|
|
def finish(state: State): Unit
|
2009-11-09 15:34:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
2009-12-05 03:31:03 +01:00
|
|
|
def finish(state: Unit) = ()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Use when a stack trace is not useful */
|
|
|
|
|
final class TestFailed(msg: String) extends RuntimeException(msg)
|
|
|
|
|
{
|
|
|
|
|
override def fillInStackTrace = this
|
2009-11-09 15:34:52 +01:00
|
|
|
}
|