diff --git a/junit-interface/src/main/java/munit/internal/junitinterface/EventDispatcher.java b/junit-interface/src/main/java/munit/internal/junitinterface/EventDispatcher.java index d49a4eaa..70e7014d 100644 --- a/junit-interface/src/main/java/munit/internal/junitinterface/EventDispatcher.java +++ b/junit-interface/src/main/java/munit/internal/junitinterface/EventDispatcher.java @@ -75,9 +75,11 @@ public void testAssumptionFailure(final Failure failure) { failure.getDescription(), new ErrorEvent(failure, Status.Skipped) { void logTo(RichLogger logger) { - if (settings.verbose) { - logger.info(Ansi.c("==> i " + failure.getDescription().getMethodName(), WARNMSG)); - } + logger.warn( + settings.buildTestResult(Status.Skipped) + + ansiName + + Ansi.c(" skipped", SKIPPED) + + durationSuffix()); } }); } @@ -134,7 +136,7 @@ void logTo(RichLogger logger) { logger.warn( settings.buildTestResult(Status.Ignored) + ansiName - + " ignored" + + Ansi.c(" ignored", SKIPPED) + durationSuffix()); } }); @@ -163,7 +165,7 @@ private void recordStartTime(Description description) { private Long elapsedTime(Description description) { Long startTime = startTimes.get(description.getMethodName()); if (startTime == null) { - return 0l; + return 0L; } else { return System.currentTimeMillis() - startTime; } diff --git a/munit/js-native/src/main/scala/munit/internal/junitinterface/JUnitReporter.scala b/munit/js-native/src/main/scala/munit/internal/junitinterface/JUnitReporter.scala index a65fdefc..03d03f64 100644 --- a/munit/js-native/src/main/scala/munit/internal/junitinterface/JUnitReporter.scala +++ b/munit/js-native/src/main/scala/munit/internal/junitinterface/JUnitReporter.scala @@ -30,9 +30,7 @@ final class JUnitReporter( } def reportTestIgnored(method: String): Unit = { - if (settings.verbose) { - log(Info, AnsiColors.c(s"==> i $method ignored", AnsiColors.YELLOW)) - } + log(Info, AnsiColors.c(s"==> i $method ignored", AnsiColors.YELLOW)) emitEvent(method, Status.Ignored) } def reportAssumptionViolation( @@ -40,9 +38,7 @@ final class JUnitReporter( timeInSeconds: Double, e: Throwable ): Unit = { - if (settings.verbose) { - log(Info, AnsiColors.c(s"==> s $method skipped", AnsiColors.YELLOW)) - } + log(Info, AnsiColors.c(s"==> s $method skipped", AnsiColors.YELLOW)) emitEvent(method, Status.Skipped, new OptionalThrowable(e)) } def reportTestPassed(method: String, elapsedMillis: Double): Unit = { diff --git a/tests/shared/src/main/scala/munit/SkippedFrameworkSuite.scala b/tests/shared/src/main/scala/munit/SkippedFrameworkSuite.scala index 6e9781b7..53e60ea2 100644 --- a/tests/shared/src/main/scala/munit/SkippedFrameworkSuite.scala +++ b/tests/shared/src/main/scala/munit/SkippedFrameworkSuite.scala @@ -27,33 +27,35 @@ object SkippedFrameworkSuite format = SbtFormat ) -object SkippedFrameworkStdoutOtherSuite +object SkippedFrameworkStdoutJsNativeSuite extends FrameworkTest( classOf[SkippedFrameworkSuite], """|munit.SkippedFrameworkSuite: | + pass + |==> i ignore ignored | + assume(true) + |==> s assume(false) skipped |""".stripMargin, format = StdoutFormat, tags = Set(NoJVM) ) -object SkippedFrameworkStdoutOtherVerboseSuite - extends FrameworkTest( - classOf[SkippedFrameworkSuite], - """|munit.SkippedFrameworkSuite: - |pass started - | + pass - |==> i ignore ignored - |assume(true) started - | + assume(true) - |assume(false) started - |==> s assume(false) skipped - |""".stripMargin, - format = StdoutFormat, - tags = Set(NoJVM), - arguments = Array("-v") - ) +object SkippedFrameworkStdoutJsNativeVerboseSuite + extends FrameworkTest( + classOf[SkippedFrameworkSuite], + """|munit.SkippedFrameworkSuite: + |pass started + | + pass + |==> i ignore ignored + |assume(true) started + | + assume(true) + |assume(false) started + |==> s assume(false) skipped + |""".stripMargin, + format = StdoutFormat, + tags = Set(NoJVM), + arguments = Array("-v") + ) object SkippedFrameworkStdoutJVMSuite extends FrameworkTest( @@ -62,6 +64,7 @@ object SkippedFrameworkStdoutJVMSuite | + pass |==> i munit.SkippedFrameworkSuite.ignore ignored | + assume(true) + |==> s munit.SkippedFrameworkSuite.assume(false) skipped |""".stripMargin, format = StdoutFormat, tags = Set(OnlyJVM) @@ -78,7 +81,7 @@ object SkippedFrameworkStdoutJVMVerboseSuite |munit.SkippedFrameworkSuite.assume(true) started | + assume(true) |munit.SkippedFrameworkSuite.assume(false) started - |==> i assume(false) + |==> s munit.SkippedFrameworkSuite.assume(false) skipped |Test run munit.SkippedFrameworkSuite finished: 0 failed, 1 ignored, 3 total, |""".stripMargin, format = StdoutFormat, diff --git a/tests/shared/src/test/scala/munit/FrameworkSuite.scala b/tests/shared/src/test/scala/munit/FrameworkSuite.scala index 6aea344f..26009fe6 100644 --- a/tests/shared/src/test/scala/munit/FrameworkSuite.scala +++ b/tests/shared/src/test/scala/munit/FrameworkSuite.scala @@ -2,41 +2,41 @@ package munit class FrameworkSuite extends BaseFrameworkSuite { val tests: List[FrameworkTest] = List[FrameworkTest]( -// SwallowedExceptionSuite, -// InterceptFrameworkSuite, -// CiOnlyFrameworkSuite, -// DiffProductFrameworkSuite, -// FailFrameworkSuite, -// FailSuiteFrameworkSuite, -// TestNameFrameworkSuite, -// ScalaVersionFrameworkSuite, -// FixtureOrderFrameworkSuite, -// TagsIncludeFramweworkSuite, -// TagsIncludeExcludeFramweworkSuite, -// TagsExcludeFramweworkSuite, -// SuiteTransformCrashFrameworkSuite, -// SuiteTransformFrameworkSuite, -// TestTransformCrashFrameworkSuite, -// TestTransformFrameworkSuite, -// ValueTransformCrashFrameworkSuite, -// ValueTransformFrameworkSuite, -// ScalaCheckFrameworkSuite, -// AsyncFunFixtureFrameworkSuite, -// AsyncFixtureTeardownFrameworkSuite, -// DuplicateNameFrameworkSuite, -// FullStackTraceFrameworkSuite, -// SmallStackTraceFrameworkSuite, -// AssertionsFrameworkSuite, -// Issue179FrameworkSuite, -// Issue285FrameworkSuite, -// Issue497FrameworkSuite, -// Issue583FrameworkSuite, -// ScalaCheckExceptionFrameworkSuite, -// BoxedFrameworkSuite, + SwallowedExceptionSuite, + InterceptFrameworkSuite, + CiOnlyFrameworkSuite, + DiffProductFrameworkSuite, + FailFrameworkSuite, + FailSuiteFrameworkSuite, + TestNameFrameworkSuite, + ScalaVersionFrameworkSuite, + FixtureOrderFrameworkSuite, + TagsIncludeFramweworkSuite, + TagsIncludeExcludeFramweworkSuite, + TagsExcludeFramweworkSuite, + SuiteTransformCrashFrameworkSuite, + SuiteTransformFrameworkSuite, + TestTransformCrashFrameworkSuite, + TestTransformFrameworkSuite, + ValueTransformCrashFrameworkSuite, + ValueTransformFrameworkSuite, + ScalaCheckFrameworkSuite, + AsyncFunFixtureFrameworkSuite, + AsyncFixtureTeardownFrameworkSuite, + DuplicateNameFrameworkSuite, + FullStackTraceFrameworkSuite, + SmallStackTraceFrameworkSuite, + AssertionsFrameworkSuite, + Issue179FrameworkSuite, + Issue285FrameworkSuite, + Issue497FrameworkSuite, + Issue583FrameworkSuite, + ScalaCheckExceptionFrameworkSuite, + BoxedFrameworkSuite, SkippedFrameworkSuite, - SkippedFrameworkStdoutOtherSuite, + SkippedFrameworkStdoutJsNativeSuite, SkippedFrameworkStdoutJVMSuite, - SkippedFrameworkStdoutOtherVerboseSuite, + SkippedFrameworkStdoutJsNativeVerboseSuite, SkippedFrameworkStdoutJVMVerboseSuite ) tests.foreach { t => check(t) }