| | 10 | |
| | 11 | # |
| | 12 | # run-smoke.pl /some/sandbox/dir /some/www/file.html |
| | 13 | # |
| | 14 | my $pugs_sandbox = $ARGV[0] or die "Need pugs sandbox location"; |
| | 15 | my $html_location = $ARGV[1] or die "Need HTML output file location"; |
| | 16 | my $optional_args = $ARGV[2] || ""; |
| | 17 | |
| | 18 | |
| | 19 | sub check_prereq { |
| | 20 | my ($mod) = @_; |
| | 21 | (my $file = $mod) =~ s,::,/,g; |
| | 22 | if (eval { require "$file.pm"; 1 }) { |
| | 23 | return 1; |
| | 24 | } |
| | 25 | else { |
| | 26 | warn "$mod - missing dependency\n"; |
| | 27 | warn "($@)\n" if $@ and $@ !~ /Can't locate \Q$file\E/; |
| | 28 | return 0; |
| | 29 | } |
| | 30 | } |
| 28 | | # |
| 29 | | # run-smoke.pl /some/sandbox/dir /some/www/file.html |
| 30 | | # |
| 31 | | my $pugs_sandbox = $ARGV[0] or die "Need pugs sandbox location"; |
| 32 | | my $html_location = $ARGV[1] or die "Need HTML output file location"; |
| 33 | | my $optional_args = $ARGV[2] || ""; |
| 34 | | |
| 35 | | my $smoke_upload = PugsBuild::Config->lookup('smoke_upload'); |
| 36 | | my $smoke_upload_script = File::Spec->canonpath('./util/smokeserv/smokeserv-client.pl'); |
| 37 | | |
| 38 | | chdir($pugs_sandbox) or die "Could change directory: $!"; |
| | 47 | chdir($pugs_sandbox) or die "Could not change directory to '$pugs_sandbox': $!"; |
| 51 | | $ENV{HARNESS_PERL} = "$^X -I/tmp/JSPERL5 $FindBin::Bin/../perl5/PIL2JS/pugs-smokejs.pl ./pugs $optional_args" |
| 52 | | if $ENV{PUGS_RUNTIME} and $ENV{PUGS_RUNTIME} eq 'JSPERL5'; |
| 53 | | if ($ENV{PUGS_RUNTIME} and $ENV{PUGS_RUNTIME} eq 'PERL5') { |
| 54 | | $ENV{PERL5LIB} = 'blib6/pugs/perl5/lib:blib6/pugs/perl5/arch'; |
| 55 | | $ENV{HARNESS_PERL} = $^X; |
| 56 | | # $ENV{HARNESS_PERL_SWITCHES} = "blib6/pugs/perl5/lib/v6.pm"; |
| 57 | | } |
| 58 | | if ($ENV{PUGS_RUNTIME} and $ENV{PUGS_RUNTIME} eq 'REDSIX') { |
| 59 | | $ENV{HARNESS_PERL} = "./pugs -Bredsix"; |
| | 60 | $ENV{HARNESS_PERL} = "$^X $FindBin::Bin/../perl5/PIL2JS/pugs-smokejs.pl ./pugs $optional_args" |
| | 61 | } elsif ($ENV{PUGS_RUNTIME} eq 'JSPERL5') { |
| | 62 | $ENV{HARNESS_PERL} = "$^X -I/tmp/JSPERL5 $FindBin::Bin/../perl5/PIL2JS/pugs-smokejs.pl ./pugs $optional_args" |
| | 63 | } elsif ($ENV{PUGS_RUNTIME} eq 'PERL5') { |
| | 64 | $ENV{PERL5LIB} = 'blib6/pugs/perl5/lib:blib6/pugs/perl5/arch'; |
| | 65 | $ENV{HARNESS_PERL} = $^X; |
| | 66 | #$ENV{HARNESS_PERL_SWITCHES} = "blib6/pugs/perl5/lib/v6.pm"; |
| | 67 | } elsif ($ENV{PUGS_RUNTIME} eq 'REDSIX') { |
| | 68 | $ENV{HARNESS_PERL} = "./pugs -Bredsix"; |
| | 69 | } |
| 91 | | push @yaml_harness_args, ('--output-file', $yml_location); |
| 92 | | system($^X, qw(-w ./util/yaml_harness.pl), |
| 93 | | @yaml_harness_args) == 0 or die "Could not run yaml harness: $!"; |
| 94 | | system($^X, qw(-w ./util/testgraph.pl), ('--inlinecss', $yml_location), $html_location) == 0 or die "Could not convert .yml to testgraph: $!"; |
| 95 | | upload_smoke($html_location, $yml_location); |
| | 99 | # Attempting the smoke |
| | 100 | system($^X, qw(-w ./util/yaml_harness.pl), @yaml_harness_args) == 0 |
| | 101 | or die "Could not run yaml harness: $!"; |
| | 102 | system($^X, qw(-w ./util/testgraph.pl), ('--inlinecss', $yml_location), $html_location) == 0 |
| | 103 | or die "Could not convert .yml to testgraph: $!"; |
| | 104 | |
| | 105 | if (defined $ENV{PUGS_SMOKE_UPLOAD}) { |
| | 106 | system("$^X $ENV{PUGS_SMOKE_UPLOAD} $html_location $yml_location") == 0 |
| | 107 | or die "Couldn't run user smoke upload command: $!"; |
| | 108 | } |
| | 109 | my $smoke_upload = PugsBuild::Config->lookup('smoke_upload'); |
| | 110 | my $smoke_upload_script = File::Spec->canonpath('./util/smokeserv/smokeserv-client.pl'); |