On Wed, May 6, 2009 at 11:00 PM, James E Keenan <[email protected]> wrote:
> There was a speaker cancellation at tonight's meeting of the New York City
> BSD Users Group (http://www.nycbug.org/), so the meeting became 'open
> format'.  I volunteered to give a summary of current developments in Parrot.
>  I improvised for about 12 minutes, but with Q&A I had the floor for a total
> of 35 minutes.
>
> In the course of the discussion one member challenged me, "Suppose I want to
> start smoke testing Parrot tonight.  Is there one shell script I could run
> that would do it all?"
>
> I didn't have an answer off the top of my head but promised to get back to
> him.  When I got home, I wrote the attached Perl 5 program.  Perl 5 for two
> reasons:  (1) I think much faster in Perl than in shell; (2) Certain CPAN
> modules are needed for submission of the tarball to Smolder.
>
> The objective would be a program someone could drop into a cron job and have
> it run once a day, cleaning up after itself.
>
> This is a first draft, so suggestions for improvement are welcome.
>
> Thank you very much.
> kid51
>
> #!/usr/local/bin/perl
> # parrot_make_smolder.pl
> use strict;
> use warnings;
> use Data::Dumper;
> use Carp;
> use Cwd;
> use File::Temp qw( tempdir );
> use Archive::Tar;
> use TAP::Harness::Archive;
>
> my $configure_log = q{parrot_configure.log};
>
> my $cwd = cwd();
> {
>    my $tdir = tempdir( CLEANUP => 1 );
>    chdir $tdir or croak "Unable to change to temporary directory";
>
>    system(qq{svn co https://svn.parrot.org/parrot/trunk parrot})
>        and croak "Unable to check out Parrot trunk from repository";
>    chdir q{parrot} or croak "Unable to change to top-level Parrot
> directory";
>
>    system(qq{$^X Configure.pl --test 2>&1 | tee $configure_log})
>        and croak "Parrot configuration or pre-/post-configuration testing
> did not complete successfully";
>
>    system( qq{make && make smolder_test 2>&1} )
>        and croak "Unable to complete 'make' and/or 'make smolder_test'";
>
>    chdir $cwd or croak "Unable to change back to starting directory";
> }
>
> print localtime() . ":  completed Parrot Smolder report\n";
>

Here's mine that I run from cron.

#!/usr/local/bin/perl

use strict;
use warnings;

use File::Temp qw/tempdir/;

# we'll get email from cron with details, don't bother keeping
# the working directory around.
my $tempdir = tempdir(CLEANUP => 1);

# Add paths to the development tools.
$ENV{PATH} = "/bin:/usr/bin";

# Where's the source?
my $PARROT_TRUNK = 'https://svn.parrot.org/parrot/trunk';

# get the latest version, configure, and test it.
chdir $tempdir;
system("svn co $PARROT_TRUNK .");
system("$^X Configure.pl");
system('make smolder_test');
system("$^X t/harness --code-tests --archive --send-to-smolder");


-- 
Will "Coke" Coleda
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to