Tests

sbt.Tests
object Tests

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Tests.type

Members list

Type members

Classlikes

final case class Argument(framework: Option[TestFramework], args: List[String]) extends TestOption

Defines arguments to pass to test frameworks.

Defines arguments to pass to test frameworks.

Value parameters

args

The list of arguments to pass to the selected framework(s).

framework

The test framework the arguments apply to if one is specified in Some. If None, the arguments will apply to all test frameworks.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TestOption
class Object
trait Matchable
class Any
Show all
final case class Cleanup(cleanup: ClassLoader => Unit) extends TestOption

Defines a TestOption that will evaluate cleanup after all tests execute. The ClassLoader provided to cleanup is the loader containing the test classes that ran. Cleanup is not currently performed for forked tests.

Defines a TestOption that will evaluate cleanup after all tests execute. The ClassLoader provided to cleanup is the loader containing the test classes that ran. Cleanup is not currently performed for forked tests.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TestOption
class Object
trait Matchable
class Any
Show all
final case class Exclude(tests: Iterable[String]) extends TestOption

The names of tests to explicitly exclude from execution.

The names of tests to explicitly exclude from execution.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TestOption
class Object
trait Matchable
class Any
Show all
final case class Execution(options: Seq[TestOption], parallel: Boolean, tags: Seq[(Tag, Int)])

Configures test execution.

Configures test execution.

Value parameters

options

The options to apply to this execution, including test framework arguments, filters, and setup and cleanup work.

parallel

If true, execute each unit of work returned by the test frameworks in separate sbt.Tasks. If false, execute all work in a single sbt.Task.

tags

The tags that should be added to each test task. These can be used to apply restrictions on concurrent execution.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Filter(filterTest: String => Boolean) extends TestOption

Selects tests by name to run. Only tests for which filterTest returns true will be run.

Selects tests by name to run. Only tests for which filterTest returns true will be run.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TestOption
class Object
trait Matchable
class Any
Show all
final case class Filters(filterTest: Seq[String => Boolean]) extends TestOption

Test execution will be ordered by the position of the matching filter.

Test execution will be ordered by the position of the matching filter.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TestOption
class Object
trait Matchable
class Any
Show all
final class Group(val name: String, val tests: Seq[TestDefinition], val runPolicy: TestRunPolicy, val tags: Seq[(Tag, Int)]) extends Product, Serializable

A named group of tests configured to run in the same JVM or be forked.

A named group of tests configured to run in the same JVM or be forked.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Group extends AbstractFunction3[String, Seq[TestDefinition], TestRunPolicy, Group], Serializable

Attributes

Companion
class
Supertypes
trait Serializable
class AbstractFunction3[String, Seq[TestDefinition], TestRunPolicy, Group]
trait (String, Seq[TestDefinition], TestRunPolicy) => Group
class Object
trait Matchable
class Any
Show all
Self type
Group.type
case object InProcess extends TestRunPolicy

Configures a group of tests to run in the same JVM.

Configures a group of tests to run in the same JVM.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
InProcess.type
final case class Listeners(listeners: Iterable[TestReportListener]) extends TestOption

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TestOption
class Object
trait Matchable
class Any
Show all
final case class Output(overall: TestResult, events: Map[String, SuiteResult], summaries: Iterable[Summary])

The result of a test run.

The result of a test run.

Value parameters

events

The result of each test group (suite) executed during this test run.

overall

The overall result of execution across all tests for all test frameworks in this test run.

summaries

Explicit summaries directly provided by test frameworks. This may be empty, in which case a default summary will be generated.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Setup(setup: ClassLoader => Unit) extends TestOption

Defines a TestOption that will evaluate setup before any tests execute. The ClassLoader provided to setup is the loader containing the test classes that will be run. Setup is not currently performed for forked tests.

Defines a TestOption that will evaluate setup before any tests execute. The ClassLoader provided to setup is the loader containing the test classes that will be run. Setup is not currently performed for forked tests.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TestOption
class Object
trait Matchable
class Any
Show all
final case class SubProcess(config: ForkOptions) extends TestRunPolicy

Configures a group of tests to be forked in a new JVM with forking options specified by config.

Configures a group of tests to be forked in a new JVM with forking options specified by config.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Summary(name: String, summaryText: String)

Summarizes a test run.

Summarizes a test run.

Value parameters

name

The name of the test framework providing this summary.

summaryText

The summary message for tests run by the test framework.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait TestRunPolicy

Configures whether a group of tests runs in the same JVM or are forked.

Configures whether a group of tests runs in the same JVM or are forked.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object InProcess.type
class SubProcess

Types

type TestRunnable = (String, TestFunction)

Value members

Concrete methods

def Argument(args: String*): Argument

Defines a TestOption that passes arguments args to all test frameworks.

Defines a TestOption that passes arguments args to all test frameworks.

Attributes

def Argument(tf: TestFramework, args: String*): Argument

Defines a TestOption that passes arguments args to only the test framework tf.

Defines a TestOption that passes arguments args to only the test framework tf.

Attributes

def Cleanup(cleanup: () => Unit): Cleanup

Defines a TestOption that will evaluate cleanup after all tests execute. Cleanup is not currently performed for forked tests.

Defines a TestOption that will evaluate cleanup after all tests execute. Cleanup is not currently performed for forked tests.

Attributes

def Setup(setup: () => Unit): Setup

Defines a TestOption that will evaluate setup before any tests execute. Setup is not currently performed for forked tests.

Defines a TestOption that will evaluate setup before any tests execute. Setup is not currently performed for forked tests.

Attributes

def allDefs(analysis: CompileAnalysis): Seq[Definition]
def apply(frameworks: Map[TestFramework, Framework], testLoader: ClassLoader, runners: Map[TestFramework, Runner], o: ProcessedOptions, config: Execution, log: ManagedLogger): Task[Output]
def apply(frameworks: Map[TestFramework, Framework], testLoader: ClassLoader, runners: Map[TestFramework, Runner], discovered: Vector[TestDefinition], config: Execution, log: ManagedLogger): Task[Output]
def discover(frameworks: Seq[Framework], analysis: CompileAnalysis, log: Logger): (Seq[TestDefinition], Set[String])
def discover(fingerprints: Seq[Fingerprint], definitions: Seq[Definition], log: Logger): (Seq[TestDefinition], Set[String])
def foldTasks(results: Seq[Task[Output]], parallel: Boolean): Task[Output]
def makeParallel(loader: ClassLoader, runnables: Iterable[TestRunnable], setupTasks: Task[Unit], tags: Seq[(Tag, Int)]): Task[Map[String, SuiteResult]]
def makeSerial(loader: ClassLoader, runnables: Seq[TestRunnable], setupTasks: Task[Unit]): Task[List[(String, SuiteResult)]]
def overall(results: Iterable[TestResult]): TestResult
def processResults(results: Iterable[(String, SuiteResult)]): Output
def testTask(loader: ClassLoader, frameworks: Map[TestFramework, Framework], runners: Map[TestFramework, Runner], tests: Vector[TestDefinition], userSetup: Iterable[ClassLoader => Unit], userCleanup: Iterable[ClassLoader => Unit], log: ManagedLogger, testListeners: Vector[TestReportListener], config: Execution): Task[Output]
def toTask(loader: ClassLoader, name: String, fun: TestFunction, tags: Seq[(Tag, Int)]): Task[Map[String, SuiteResult]]
def toTasks(loader: ClassLoader, runnables: Seq[TestRunnable], tags: Seq[(Tag, Int)]): Task[Map[String, SuiteResult]]

Deprecated methods

def makeSerial(loader: ClassLoader, runnables: Seq[TestRunnable], setupTasks: Task[Unit], tags: Seq[(Tag, Int)]): Task[List[(String, SuiteResult)]]

Attributes

Deprecated
true