NAME
Test::CPAN::Health::Check::Benchmarks - Check that benchmark scripts are present
SYNOPSIS
use Test::CPAN::Health::Check::Benchmarks;
my $check = Test::CPAN::Health::Check::Benchmarks->new;
my $result = $check->run($dist);
DESCRIPTION
Checks for the presence of a bench/, benchmarks/, or benchmark/ directory containing at least one file.
Score matrix:
100 -- benchmarks directory found with at least one file.
50 -- benchmarks directory found but empty.
0 -- no benchmarks directory found.
run
PURPOSE
Locate a benchmarks directory and report whether it contains files.
API SPECIFICATION
INPUT
dist Test::CPAN::Health::Distribution required
context Hashref optional (unused)
OUTPUT
Test::CPAN::Health::Result with:
check_id 'benchmarks'
status 'pass' | 'warn' | 'fail'
score 100 | 50 | 0
summary human-readable verdict
MESSAGES
Code | Severity | Message | Resolution
------+----------+------------------------------------+---------------------
BM001 | FAIL | No benchmarks directory found | Add a bench/ or benchmarks/ directory
BM002 | WARN | Benchmarks directory is empty | Add at least one benchmark script
BM003 | PASS | Benchmarks directory found |
FORMAL SPECIFICATION
-- Z schema (placeholder) --
BenchmarksOp
dist : Distribution
score : {0, 50, 100}
-------------------------------------------------------
no_dir => score = 0
dir_empty => score = 50
dir_nonempty => score = 100
SIDE EFFECTS
Reads directory listings from disk.
USAGE EXAMPLE
my $result = Test::CPAN::Health::Check::Benchmarks->new->run($dist);
AUTHOR
Nigel Horne, <njh at nigelhorne.com>
LICENSE AND COPYRIGHT
Copyright (C) 2025-2026 Nigel Horne.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.