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:
Eruis2579 2026-02-11 01:43:15 -05:00
parent 68109b8adb
commit 83b7a9e699
1 changed files with 9 additions and 0 deletions

View File

@ -133,6 +133,9 @@ object Tests {
/** Test execution will be ordered by the position of the matching filter. */
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. */
def Argument(args: String*): Argument = Argument(None, args.toList)
@ -247,10 +250,13 @@ object Tests {
val testFilters = new ListBuffer[String => Boolean]
var orderedFilters = Seq[String => Boolean]()
val excludeTestsSet = new HashSet[String]
var explicitlyRequestedNames = Set.empty[String]
val setup, cleanup = new ListBuffer[ClassLoader => Unit]
val testListeners = new ListBuffer[TestReportListener]
val undefinedFrameworks = new ListBuffer[String]
def isExplicitFqn(s: String): Boolean = !s.contains('*') && !s.contains('?')
for (option <- config.options) {
option match {
case Filter(include) => testFilters += include; ()
@ -258,6 +264,9 @@ object Tests {
if (orderedFilters.nonEmpty) sys.error("Cannot define multiple ordered test filters.")
else orderedFilters = includes
()
case ExplicitlyRequestedNames(names) =>
explicitlyRequestedNames = names.filter(isExplicitFqn).toSet
()
case Exclude(exclude) => excludeTestsSet ++= exclude; ()
case Listeners(listeners) => testListeners ++= listeners; ()
case Setup(setupFunction, _) => setup += setupFunction; ()