How to show only stdout scan test if it doesn't work

With junit-interface, a runner was such a convenient option:

-q Suppress stdout for successful tests. Stderr prints to the console as usual. Stdout is written to the buffer and discarded when tested succeeds. If this fails, the buffer is flushed to the console. Since stdio redirecting to Java is a bad kludge (System.setOut () changes the static final field of System.out through native code), this may not work for all scripts. Scala has its own reprogramming console. If Scala is found in the class path, the junit interface tries to redirect scala. The stdout console too.

I was wondering if there is an easy way to make scalatest do the same. I can try redirecting the output myself, but would prefer to use something standard if possible.

+6
source share
1 answer

According to this info on the ScalaTest website, you can set some flags to suppress some messages:

If you add this line to your build.sbt file, your registrar will not show successful tests in standard mode:

testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oN")

0
source

Source: https://habr.com/ru/post/951048/


All Articles