Implement strict constructors, which will warn unkown constructor arguments
[gitmo/Mouse.git] / author / he-profile.pl
1 #!perl -w
2 # Usage: perl author/profile.pl (no other options including -Mblib are reqired)
3
4 use strict;
5
6 my $script = 'author/use-he.pl';
7
8 my $branch = do{
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     }
20 };
21
22 print "Profiling $branch ...\n";
23
24 my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', '-d:NYTProf', $script);
25
26 print "> @cmd\n";
27 system(@cmd) == 0 or die "Cannot profile (\$?=$?)";
28 system(@cmd) == 0 or die "Cannot profile (\$?=$?)";
29 system(@cmd) == 0 or die "Cannot profile (\$?=$?)";
30
31 @cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch");
32 print "> @cmd\n";
33 system(@cmd) == 0 or die "Cannot profile (\$?=$?)";