---
name: "Test2::Harness::Runner"
section: "3pm"
platform: "linux"
package: "libtest2-harness-perl"
version: "1.000158-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Test2::Harness::Runner"
---

# Test2::Harness::Runner(3pm)

Base class for test runners

## NAME

Test2::Harness::Runner - Base class for test runners

## DESCRIPTION

This module does the heavy lifting of running all the tests.

You should never need to create an instance of the runner yourself. In most cases the runner module is exposed via a callback or a plugin affordance.

## PUBLIC METHODS

### FROM SETTINGS

These are attributesd with values set from the Test2::Harness::Settings instance created from command line arguments.

See App::Yath::Options::Runner for the most up to date documentation on these.

- $runner-\>includes

  - $runner-\>tlib

  - $runner-\>lib

  - $runner-\>blib

  - $runner-\>unsafe\_inc

  - $runner-\>use\_fork

  - $runner-\>preloads

  - $runner-\>preload\_threshold

  - $runner-\>switches

  - $runner-\>cover

  - $runner-\>event\_timeout

  - $runner-\>post\_exit\_timeout

  ### FROM CONSTRUCTION

These attributes are set when the runner is created.

- $path = $runner-\>dir

  Path to the working directory.

- $settings = $runner-\>settings

  The App::Yath::Settings instance.

- $coderef = $runner-\>fork\_job\_callback

  Callback used to spawn new tests via fork.

- $coderef = $runner-\>respawn\_runner\_callback

  Callback to restart the runner process.

- $bool = $runner-\>monitor\_preloads

  True if preloads should be watched for changes.

- $int = $runner-\>jobs\_todo

  A count of total jobs to run. This will always be 0 in a persistent runner.

### OTHER PUBLIC METHODS

If a method is not documented here then it is an implementation detail and you should not use it.

- $class = $runner-\>job\_class

  Class for new test jobs.

- $preload = $runner-\>preloader

  Get the Test2::Harness::Runner::Preloader instance.

- $state = $runner-\>state

  Get the Test2::Harness::Runner::State instance.

- @list = $runner-\>all\_libs

  Get all the libs that should be added to `@INC` by default. Note that specific runs and even specific tests can have custom paths on top of these.

## SOURCE

The source code repository for Test2-Harness can be found at *http://github.com/Test-More/Test2-Harness/*.

## MAINTAINERS

- Chad Granum \<exodist@cpan.org\>

  ## AUTHORS

- Chad Granum \<exodist@cpan.org\>

  ## COPYRIGHT

Copyright 2020 Chad Granum \<exodist7@gmail.com\>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See *http://dev.perl.org/licenses/*
