Fix call to smolder_smoke_signal so that it chomp()s $archname
[Math-GSL.git] / bin / smolder_mathgsl
blob026296323745ad33608d47ad6d6201f1de336866
1 #!/usr/local/bin/perl5.10 -w
2 use strict;
3 use warnings;
4 use Config;
5 use TAP::Harness::Archive;
6 use Data::Dumper;
7 use lib 'lib';
8 use Math::GSL;
9 $|++;
11 my $archive = shift || 'my_test_run.tar.gz';
12 my $server = 'smolder.plusthree.com';
13 my ($user,$pass) = qw/leto bessel_J0/;
14 my $archname = $Config{archname};
15 if ($archname =~ /darwin/i){
16     chomp($archname = `uname -p`);
18 my $me = $^O eq 'MSWin32' ? $ENV{'USERNAME'}
19         : $ENV{'LOGNAME'} || eval { getpwuid($<) };
21 my $domain = 'unknown';
22 if ($^O eq 'MSWin32') {
23     $domain = $ENV{'USERDOMAIN'};
24 } else {
25     eval { require Sys::Hostname; $domain = Sys::Hostname::hostname(); };
28 my ($git_id,$git_branch) = ('','');
30 if ( -e '.git' ) {
31     chomp($git_id = `git log -p -n 1|grep commit`);
32     $git_id =~ s/commit //;
33     chomp($git_branch = `git branch | grep "^\*"`);
34     $git_branch =~ s/\* //;
36 my $properties = {
37     'Math::GSL'     => $Math::GSL::VERSION,
38     'Git Commit'    => $git_id,
39     'Git Branch'    => $git_branch,
40     'Submitter'     => "$me\@$domain",
41     'Perl Version'  => $Config{version},
42     'Config Args'   => $Config{config_args},
43     'CC Flags'      => $Config{ccflags},
44     'Double Size'   => $Config{doublesize},
45     'Long Doubles'  => $Config{uselongdouble},
46     'Multiplicity'  => $Config{usemultiplicity},
47     '64bit ints'    => $Config{use64bitint},
48     '64bit all'     => $Config{use64bitall},
49     'Patch level'   => $Config{version_patchlevel_string},
50     'Perl @INC'     => join(":",@INC),
51     'PERL5LIB'      => $ENV{PERL5LIB},
53 my @files = glob('t/*.t');
54 my %options = (
55            verbosity        => 0,
56            jobs             => 2,
57            merge            => 1,
58            lib              => [ 'lib', 'blib/lib', 'blib/arch' ],
59            archive          => $archive,
60            extra_properties => $properties,
61            extra_files      => [ ],
65 my $harness = TAP::Harness::Archive->new(\%options);
66 $harness->runtests(@files);
67 my $cmd =<<CMD;
68 smolder_smoke_signal --server $server \\
69     --username $user --password $pass --file $archive \\
70     --project Math::GSL --platform $Config{osname} --architecture $archname --tags "\$USER , Math::GSL $Math::GSL::VERSION, $git_branch, Perl $Config{version}"
71 CMD
72 print "about to do:\n$cmd\n";
74 system $cmd;
76 if ($? == -1) {
77     print "failed to execute: $!\n";
78 } elsif ($? & 127) {
79     printf "smolder_smoke_signal died with signal %d, %s coredump\n", ($? & 127),  ($? & 128) ? 'with' : 'without';
80 } else {
81     printf "smolder_smoke_signal exited with value %d\n", $? >> 8;