NAME

App::Project::Doctor::Check::Tests - Check that a test suite exists and passes

VERSION

0.02

SYNOPSIS

my $check    = App::Project::Doctor::Check::Tests->new;
my @findings = $check->check($ctx);

DESCRIPTION

Three-stage check: (1) t/ directory present, (2) at least one .t file present, (3) prove -l exits 0. A missing test suite generates a fixable finding that creates a minimal t/00-smoke.t scaffold.

METHODS

check( $context )

API SPECIFICATION

Input

$context : App::Project::Doctor::Context

Output

List of App::Project::Doctor::Finding (at most one per stage)

MESSAGES

Code | Trigger                     | Resolution
-----|-----------------------------|-----------------------------------------
T001 | t/ missing                  | Fix creates t/ and a minimal t/00-smoke.t
T002 | t/ present, no .t files     | Fix creates a minimal t/00-smoke.t
T003 | prove exits non-zero        | Fix failing tests manually

FORMAL SPECIFICATION

check : Context -> [Finding]
check ctx ==
  if not exists "t/"         then [error+fix]
  else if |test_files| = 0   then [error+fix]
  else if prove_fails        then [error]
  else                            [pass]

AUTHOR

Nigel Horne <njh@nigelhorne.com>

LICENSE

Copyright (C) 2026 Nigel Horne. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.