在MUnit中,默认情况下,测试套件中的munit
测试会被排除在外。如果你想包括这些测试,你可以使用以下方法之一:
includeTests
属性:在munit
插件的配置中添加includeTests
属性,并指定要包括的测试类或测试套件。例如:munit {
includeTests = ['com.example.MyTest', 'com.example.AnotherTestSuite']
}
这将包括com.example.MyTest
类和com.example.AnotherTestSuite
测试套件中的所有munit
测试。
includeTags
属性:在munit
插件的配置中添加includeTags
属性,并指定要包括的测试标签。例如:munit {
includeTags = ['munit']
}
这将包括所有带有munit
标签的munit
测试。
munit
测试时,使用-includeTests
或-includeTags
参数来指定要包括的测试类、测试套件或测试标签。例如:./gradlew test -PmunitIncludeTests=com.example.MyTest
这将包括com.example.MyTest
类中的所有munit
测试。
无论你选择哪种方法,都可以在默认情况下包括被排除的munit
测试。
上一篇:包括MMSystem.h