Skip to content

Commit

Permalink
create test to document current status
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuehlke committed Apr 18, 2024
1 parent 51a37a2 commit 825c032
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 33 deletions.
2 changes: 2 additions & 0 deletions tests/shared/src/main/scala/munit/BaseSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class BaseSuite extends FunSuite {
test.tag(Ignore)
} else if (test.tags(OnlyJVM) && !PlatformCompat.isJVM) {
test.tag(Ignore)
} else if (test.tags(NoJVM) && PlatformCompat.isJVM) {
test.tag(Ignore)
} else if (test.tags(NoNative) && PlatformCompat.isNative) {
test.tag(Ignore)
} else {
Expand Down
62 changes: 61 additions & 1 deletion tests/shared/src/main/scala/munit/SkippedFrameworkSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,65 @@ object SkippedFrameworkSuite
|==> ignored munit.SkippedFrameworkSuite.ignore
|==> success munit.SkippedFrameworkSuite.assume(true)
|==> skipped munit.SkippedFrameworkSuite.assume(false) - assume it fails
|""".stripMargin
|""".stripMargin,
format = SbtFormat
)

object SkippedFrameworkStdoutOtherSuite
extends FrameworkTest(
classOf[SkippedFrameworkSuite],
"""|munit.SkippedFrameworkSuite:
| + pass <elapsed time>
| + assume(true) <elapsed time>
|""".stripMargin,
format = StdoutFormat,
tags = Set(NoJVM)
)

object SkippedFrameworkStdoutOtherVerboseSuite
extends FrameworkTest(
classOf[SkippedFrameworkSuite],
"""|munit.SkippedFrameworkSuite:
|pass started
| + pass <elapsed time>
|==> i ignore ignored
|assume(true) started
| + assume(true) <elapsed time>
|assume(false) started
|==> s assume(false) skipped
|""".stripMargin,
format = StdoutFormat,
tags = Set(NoJVM),
arguments = Array("-v")
)

object SkippedFrameworkStdoutJVMSuite
extends FrameworkTest(
classOf[SkippedFrameworkSuite],
"""|munit.SkippedFrameworkSuite:
| + pass <elapsed time>
|==> i munit.SkippedFrameworkSuite.ignore ignored <elapsed time>
| + assume(true) <elapsed time>
|""".stripMargin,
format = StdoutFormat,
tags = Set(OnlyJVM)
)

object SkippedFrameworkStdoutJVMVerboseSuite
extends FrameworkTest(
classOf[SkippedFrameworkSuite],
"""|munit.SkippedFrameworkSuite started
|munit.SkippedFrameworkSuite:
|munit.SkippedFrameworkSuite.pass started
| + pass <elapsed time>
|==> i munit.SkippedFrameworkSuite.ignore ignored <elapsed time>
|munit.SkippedFrameworkSuite.assume(true) started
| + assume(true) <elapsed time>
|munit.SkippedFrameworkSuite.assume(false) started
|==> i assume(false)
|Test run munit.SkippedFrameworkSuite finished: 0 failed, 1 ignored, 3 total, <elapsed time>
|""".stripMargin,
format = StdoutFormat,
tags = Set(OnlyJVM),
arguments = Array("-v")
)
1 change: 1 addition & 0 deletions tests/shared/src/main/scala/munit/Tags.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package munit

object OnlyJVM extends Tag("OnlyJVM") {}
object NoJVM extends Tag("NoJVM") {}
object NoDotty extends Tag("NoDotty") {}
object Only213 extends Tag("Only213") {}
object NoNative extends Tag("NoNative") {}
68 changes: 36 additions & 32 deletions tests/shared/src/test/scala/munit/FrameworkSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,42 @@ 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,
SkippedFrameworkSuite
// 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,
SkippedFrameworkStdoutJVMSuite,
SkippedFrameworkStdoutOtherVerboseSuite,
SkippedFrameworkStdoutJVMVerboseSuite
)
tests.foreach { t => check(t) }
}

0 comments on commit 825c032

Please sign in to comment.