DBIO
view release on metacpan or search on metacpan
examples/Benchmarks/benchmark_hashrefinflator.pl view on Meta::CPAN
no-cpufreq-checks
/);
if (
!$args->{'no-cpufreq-checks'}
and
$^O eq 'linux'
and
-r '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq'
) {
my ($min_freq, $max_freq, $governor) = map { local @ARGV = $_; my $s = <>; chomp $s; $s } qw|
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
|;
if ($min_freq != $max_freq) {
die "Your OS seems to have an active CPU governor '$governor' -"
. ' this will render benchmark results meaningless. Disable it'
. ' by setting /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq'
. ' to the same value as /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq'
examples/Benchmarks/benchmark_hashrefinflator.pl view on Meta::CPAN
last if @to_bench == $args->{'bench-commits'};
$not_latest = 1;
}
}
die "Can't find any commits... something is wrong\n" unless @to_bench;
unshift @to_bench, {
desc => "the current uncommitted HRI...\t\t\t\t",
title => 'CURRENT',
code => do { local (@ARGV, $/) = ($hri_fn); <> },
} if `git status --porcelain $hri_fn`;
printf "\nAbout to benchmark %d HRI variants (%s)\n",
scalar @to_bench,
(join ', ', map { $_->{title} } @to_bench),
;
my $schema = DBIO::Test->init_schema();
# add some extra data for the complex test
xt/footers.t view on Meta::CPAN
L<DBIO library|DBIO/COPYRIGHT AND LICENSE>.
};
find({
wanted => sub {
my $fn = $_;
return unless -f $fn;
return unless $fn =~ / \. (?: pm | pod ) $ /ix;
my $data = do { local (@ARGV, $/) = $fn; <> };
if ($data !~ /^=head1 NAME/m) {
# the generator is full of false positives, .pod is where it's at
return if $fn =~ qr{\Qlib/DBIO/Optional/Dependencies.pm};
ok ( $data !~ /\bcopyright\b/i, "No copyright notices in $fn without apparent POD" );
}
elsif ($fn =~ qr{\Qlib/DBIO.}) {
# nothing to check there - a static set of words
my @dirs = ('lib');
my @files;
find({ wanted => sub {
return unless -f $_ && /\.(?:pm|pod)$/i;
push @files, $_;
}, no_chdir => 1 }, @dirs);
for my $file (sort @files) {
my $data = do { local (@ARGV, $/) = $file; <> };
# skip files using PodWeaver directives (processed at build time)
if ($data =~ /^=(?:method|attr|func)\b/m) {
SKIP: { skip "$file uses PodWeaver directives (test via dzil test)", 1 }
next;
}
# skip files with no POD at all (internal modules)
if ($data !~ /^=(head|pod|over|item|begin|end|for|encoding|cut)\b/m) {
SKIP: { skip "$file has no POD", 1 }
xt/podcoverage.t view on Meta::CPAN
use warnings;
use strict;
use Test::More;
plan skip_all => "Skipping finicky test on older perl"
if "$]" < 5.008005;
# This test must run via 'dzil test', not 'prove xt/' directly â
# PodWeaver must have already processed the source files.
do {
my $sample = do { local (@ARGV, $/) = 'lib/DBIO/Admin.pm'; <> };
plan skip_all => 'Run via dzil test â PodWeaver must process files first (prove xt/ not supported)'
unless $sample =~ /^=head1 (?:ATTRIBUTES|METHODS)/m;
};
require DBIO;
unless ( DBIO::Optional::Dependencies->req_ok_for ('test_podcoverage') ) {
my $missing = DBIO::Optional::Dependencies->req_missing_for ('test_podcoverage');
$ENV{RELEASE_TESTING}
? die ("Failed to load release-testing module requirements: $missing")
: plan skip_all => "Test needs: $missing"
( run in 1.713 second using v1.01-cache-2.11-cpan-a9496e3eb41 )