Fix RT #54203 (reported by chocolateboy) that setters might return undef.
[gitmo/Mouse.git] / author / he-profile.pl
CommitLineData
834fbe12 1#!perl -w
2# Usage: perl author/profile.pl (no other options including -Mblib are reqired)
3
4use strict;
5
e3575663 6my $script = 'author/use-he.pl';
834fbe12 7
8my $branch = do{
e3575663 9 if(open my $in, '.git/HEAD'){
10 my $s = scalar <$in>;
11 chomp $s;
12 $s =~ s{^ref: \s+ refs/heads/}{}xms;
13 $s =~ s{/}{_}xmsg;
14 $s;
15 }
16 else{
17 require 'lib/Mouse/Spec.pm';
18 Mouse::Spec->VERSION;
19 }
834fbe12 20};
21
22print "Profiling $branch ...\n";
23
e3575663 24my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', '-d:NYTProf', $script);
834fbe12 25
26print "> @cmd\n";
3c1c1e21 27system(@cmd) == 0 or die "Cannot profile (\$?=$?)";
28system(@cmd) == 0 or die "Cannot profile (\$?=$?)";
29system(@cmd) == 0 or die "Cannot profile (\$?=$?)";
834fbe12 30
31@cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch");
32print "> @cmd\n";
3c1c1e21 33system(@cmd) == 0 or die "Cannot profile (\$?=$?)";