X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=author%2Fhe-profile.pl;h=31138be2bf2a492abf3a90499cacbc7ee1cbcda9;hp=dbab6737bfc9d9a18668dced475f97d3d8e4d0f2;hb=e128626c409797822ffd8a4079f833eb3dc0fd37;hpb=834fbe127a997bbce6487957fdeb55af71d0cae1 diff --git a/author/he-profile.pl b/author/he-profile.pl index dbab673..31138be 100644 --- a/author/he-profile.pl +++ b/author/he-profile.pl @@ -3,27 +3,31 @@ use strict; -my $script = 'bench/foo.pl'; +my $script = 'author/use-he.pl'; my $branch = do{ - open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!"; - my $s = scalar <$in>; - chomp $s; - $s =~ s{^ref: \s+ refs/heads/}{}xms; - $s =~ s{/}{_}xmsg; - $s; + if(open my $in, '.git/HEAD'){ + my $s = scalar <$in>; + chomp $s; + $s =~ s{^ref: \s+ refs/heads/}{}xms; + $s =~ s{/}{_}xmsg; + $s; + } + else{ + require 'lib/Mouse/Spec.pm'; + Mouse::Spec->VERSION; + } }; print "Profiling $branch ...\n"; -my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', '-d:NYTProf', '-e', - 'require HTTP::Engine; require HTTP::Engine::Interface::CGI'); +my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', '-d:NYTProf', $script); print "> @cmd\n"; -system(@cmd) == 0 or die "Cannot profile"; -system(@cmd) == 0 or die "Cannot profile"; -system(@cmd) == 0 or die "Cannot profile"; +system(@cmd) == 0 or die "Cannot profile (\$?=$?)"; +system(@cmd) == 0 or die "Cannot profile (\$?=$?)"; +system(@cmd) == 0 or die "Cannot profile (\$?=$?)"; @cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch"); print "> @cmd\n"; -system(@cmd) == 0 or die "Cannot profile"; +system(@cmd) == 0 or die "Cannot profile (\$?=$?)";