Try using runner arguments to configure a file reporter
-f output.txt
in combination with unformatted or "ugly" mode flag U
which
Rather than attempting to make the output look as pretty and
human-readable as possible, unformatted mode will just print out
verbose information about each event as it arrives, helping you track
down the problem you are trying to debug.
and then tail the output file during test execution
tail -f output.txt
which will show events in realtime as they are happening as opposed to at the end of testing.
Now given following example
Test / testOptions += Tests.Argument("-fU", "output.txt")
class HelloSpec extends FlatSpec with Matchers {
"The Hello object" should "satisfy case 1" in {
assert(true)
}
it should "satisfy case 2" in {
assert(true)
}
it should "satisfy case 3 (stuck here)" in {
while(true) { /* do something forever */ }
assert(true)
}
it should "satisfy case 4" in {
assert(true)
}
}
then tail -f output.txt
outputs
Run starting. Expected test count is: 0
Suite Starting - HelloSpec
Scope Opened - HelloSpec: The Hello object
Test Starting - HelloSpec: The Hello object should satisfy case 1
Test Succeeded - HelloSpec: The Hello object should satisfy case 1
Test Starting - HelloSpec: The Hello object should satisfy case 2
Test Succeeded - HelloSpec: The Hello object should satisfy case 2
Test Starting - HelloSpec: The Hello object should satisfy case 3 (stuck here)
where we can identify the stuck test on the last line.