From: Vincent Pit Date: Tue, 28 Dec 2010 11:49:55 +0000 (+0100) Subject: Add a sample contrived benchmark X-Git-Tag: v0.01~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=57d87fcd6b2d8f96a6d4d05dd7e5a46e3e1ee75c;p=perl%2Fmodules%2FTest-Leaner.git Add a sample contrived benchmark --- diff --git a/MANIFEST b/MANIFEST index b3a5263..bcb88fd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3,6 +3,7 @@ META.yml Makefile.PL README lib/Test/Leaner.pm +samples/bench.pl t/00-load.t t/01-import.t t/05-pass.t diff --git a/samples/bench.pl b/samples/bench.pl new file mode 100644 index 0000000..c84cb66 --- /dev/null +++ b/samples/bench.pl @@ -0,0 +1,13 @@ +#!perl + +use strict; +use warnings; + +use Benchmark qw; + +my $n = 10_000; + +cmpthese 10, { + 'Test::More' => sub { system "$^X -e 'use Test::More; plan q[no_plan]; pass for 1 .. $n' > /dev/null" }, + 'Test::Leaner' => sub { system "$^X -e 'use lib q[lib]; use Test::Leaner; plan q[no_plan]; pass for 1 .. $n' > /dev/null" }, +};