mirror of https://github.com/sbt/sbt.git
Add missing ExplicitlyRequestedNames case class and processOptions handling
- Define ExplicitlyRequestedNames(names: Seq[String]) extends TestOption - In processOptions: declare explicitlyRequestedNames, isExplicitFqn, match case - Fixes actionsProj/Compile compilation failure in CI
This commit is contained in:
parent
68109b8adb
commit
83b7a9e699
|
|
@ -133,6 +133,9 @@ object Tests {
|
||||||
/** Test execution will be ordered by the position of the matching filter. */
|
/** Test execution will be ordered by the position of the matching filter. */
|
||||||
final case class Filters(filterTest: Seq[String => Boolean]) extends TestOption
|
final case class Filters(filterTest: Seq[String => Boolean]) extends TestOption
|
||||||
|
|
||||||
|
/** Names explicitly requested (e.g. testOnly com.example.MySuite). Used to set explicitlySpecified on TaskDef. */
|
||||||
|
final case class ExplicitlyRequestedNames(names: Seq[String]) extends TestOption
|
||||||
|
|
||||||
/** Defines a TestOption that passes arguments `args` to all test frameworks. */
|
/** Defines a TestOption that passes arguments `args` to all test frameworks. */
|
||||||
def Argument(args: String*): Argument = Argument(None, args.toList)
|
def Argument(args: String*): Argument = Argument(None, args.toList)
|
||||||
|
|
||||||
|
|
@ -247,10 +250,13 @@ object Tests {
|
||||||
val testFilters = new ListBuffer[String => Boolean]
|
val testFilters = new ListBuffer[String => Boolean]
|
||||||
var orderedFilters = Seq[String => Boolean]()
|
var orderedFilters = Seq[String => Boolean]()
|
||||||
val excludeTestsSet = new HashSet[String]
|
val excludeTestsSet = new HashSet[String]
|
||||||
|
var explicitlyRequestedNames = Set.empty[String]
|
||||||
val setup, cleanup = new ListBuffer[ClassLoader => Unit]
|
val setup, cleanup = new ListBuffer[ClassLoader => Unit]
|
||||||
val testListeners = new ListBuffer[TestReportListener]
|
val testListeners = new ListBuffer[TestReportListener]
|
||||||
val undefinedFrameworks = new ListBuffer[String]
|
val undefinedFrameworks = new ListBuffer[String]
|
||||||
|
|
||||||
|
def isExplicitFqn(s: String): Boolean = !s.contains('*') && !s.contains('?')
|
||||||
|
|
||||||
for (option <- config.options) {
|
for (option <- config.options) {
|
||||||
option match {
|
option match {
|
||||||
case Filter(include) => testFilters += include; ()
|
case Filter(include) => testFilters += include; ()
|
||||||
|
|
@ -258,6 +264,9 @@ object Tests {
|
||||||
if (orderedFilters.nonEmpty) sys.error("Cannot define multiple ordered test filters.")
|
if (orderedFilters.nonEmpty) sys.error("Cannot define multiple ordered test filters.")
|
||||||
else orderedFilters = includes
|
else orderedFilters = includes
|
||||||
()
|
()
|
||||||
|
case ExplicitlyRequestedNames(names) =>
|
||||||
|
explicitlyRequestedNames = names.filter(isExplicitFqn).toSet
|
||||||
|
()
|
||||||
case Exclude(exclude) => excludeTestsSet ++= exclude; ()
|
case Exclude(exclude) => excludeTestsSet ++= exclude; ()
|
||||||
case Listeners(listeners) => testListeners ++= listeners; ()
|
case Listeners(listeners) => testListeners ++= listeners; ()
|
||||||
case Setup(setupFunction, _) => setup += setupFunction; ()
|
case Setup(setupFunction, _) => setup += setupFunction; ()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue