Support custom test reporter in Scala
In Scala, a custom test reporter can be used in a TestSpec. Usage: at the top of the TestSpec, create a comment such as:
//test: MyTestSuite (MyTestReporter)
This will execute the
MyTestSuite
and useMyTestReporter
to report about the results. (This is an extension of the old behavior where//test: MyTestSuite
could indicate the test suite.) Now, to create a test reporter, make a class that extends theWeblabSuiteReporter
class from Labback. For example:class MyTestReporter extends WeblabSuiteReporter { override def apply(ev: Event): Unit = { totalPoints = 100 deductedPoints = 80 failureDetails = List("You get only 2/10 score.") } }
The field
Submitted by D. Pelsmaeker on 18 February 2019 at 16:11totalPoints
is the total number of points reported, anddeductedPoints
is the number of points deducted (so in this example the student gets only 20/100). ThefailureDetails
field is a list of strings that are reported back to the student, each string on a new line.
Issue Log
On 18 February 2019 at 16:11 D. Pelsmaeker tagged 0.47.30
On 18 February 2019 at 16:12 D. Pelsmaeker closed this issue.
Log in to post comments