From 83b7a9e699fc4a61ee3965d470101fd09cf73559 Mon Sep 17 00:00:00 2001 From: Eruis2579 Date: Wed, 11 Feb 2026 01:43:15 -0500 Subject: [PATCH] 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 --- main-actions/src/main/scala/sbt/Tests.scala | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main-actions/src/main/scala/sbt/Tests.scala b/main-actions/src/main/scala/sbt/Tests.scala index 891643365..7298ef4fc 100644 --- a/main-actions/src/main/scala/sbt/Tests.scala +++ b/main-actions/src/main/scala/sbt/Tests.scala @@ -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; ()