NAME

App::Test::Generator::BenchmarkGenerator - Generate Benchmark harnesses from ATG schemas

VERSION

Version 0.42

SYNOPSIS

use App::Test::Generator::BenchmarkGenerator;
use YAML::XS qw(LoadFile);

my $schema = LoadFile('schemas/my_func.yml');
my $bg     = App::Test::Generator::BenchmarkGenerator->new(schema => $schema);
print $bg->generate();

DESCRIPTION

Given an ATG YAML schema (as produced by extract-schemas or written by hand), generates a self-contained Perl benchmark script using "cmpthese" in Benchmark.

Each transform defined in the schema becomes one variant in the cmpthese call, with representative input values derived from the transform's type and range constraints. When no transforms are defined, a single 'default' variant is emitted using the base input specification.

The generated script is a plain .pl file suitable for running directly with perl. It is not a test file and has no dependency on any test framework.

METHODS

new

API SPECIFICATION

input

schema   => HashRef   (required) - ATG schema hashref as loaded from YAML

output

An App::Test::Generator::BenchmarkGenerator object.

generate

API SPECIFICATION

input

None (reads from the schema passed to new).

output

A string containing the complete benchmark script, ready to write to a file.

AUTHOR

Nigel Horne

LICENSE

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