Skip to content

Coverage: support the turbocov driver #170

Todo

Description

@roxblnfk

Description

Testo gets a third coverage driver, turbocov: php-testo/testo#455. It is line-only like PCOV, with much lower overhead. The run configuration only offers the engines PhpStorm knows (PhpUnitCoverageEngine.CoverageEngine: Xdebug, PCOV, PHPDBG) on PhpStorm and TestoCoverageDriver on OpenIDE, so a Coverage run cannot be set up for turbocov.

How the driver behaves in Testo:

  • Testo picks turbocov before PCOV and Xdebug when the turbocov extension is loaded and can collect.
  • turbocov instruments only turbocov.collect_paths, read at compile time from ini or -d, never ini_set(). Without it turbocov is off.
  • It cannot run next to Xdebug or PCOV. When it cannot collect, Testo falls back to another loaded driver; under --coverage with none left it fails with turbocov's reason, e.g. turbocov.collect_paths is not set.
  • Linux and macOS only, PHP 8.4+.

Proposed solution

  • Add turbocov to the engine choice on both platforms. PhpStorm's enum cannot be extended, so it needs a Testo-side option next to it.
  • On launch: no pcov.enabled / XDEBUG_MODE; pass -dturbocov.collect_paths=... unless the interpreter already sets it. A default could come from the configured src of testo.php, or from a field in the configuration.
  • Extension check: refuse when turbocov is not loaded, warn when Xdebug or PCOV is loaded too (turbocov switches itself off then).
  • Branch level stays Xdebug-only (TestoCoverageArguments).

Additional context

Activity

  1. self-assigned this
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions