Skip to contents

This strategy tells if a mutant is caught by a test matching the source file name.

For example, if the source file name is foo.R, and there are test files named test-foo.R or test-bar.R, only test-foo.R will be run.

This strategy should give faster results than ?FullTestStrategy, especially for big codebases, but the score might be less accurate.

See also

Super class

muttest::TestStrategy -> FileTestStrategy

Methods


Method new()

Initialize the FileTestStrategy

Usage

FileTestStrategy$new(
  load_helpers = TRUE,
  load_package = c("source", "none", "installed")
)

Arguments

load_helpers

Whether to load test helpers

load_package

The package loading strategy


Method execute()

Execute the test strategy

Usage

FileTestStrategy$execute(path, plan, reporter)

Arguments

path

The path to the test directory

plan

The current mutation plan. See plan().

reporter

The reporter to use for test results

Returns

The test results


Method clone()

The objects of this class are cloneable with this method.

Usage

FileTestStrategy$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.