Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
We can now make Smolder shoot 500-smoke
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Jan 7, 2011
1 parent 27f1ff4 commit 3fc8dc8
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -15,3 +15,4 @@ src/gen/*.pir
src/gen/*.nqp
src/stage1
src/stage2
nqp-rx_test_run.tar.gz
4 changes: 2 additions & 2 deletions build/Makefile.in
Expand Up @@ -11,7 +11,7 @@ PARROT_LIB_DIR = @libdir@$(PARROT_VERSION)
PARROT_SRC_DIR = @srcdir@$(PARROT_VERSION)
PARROT_LIBRARY_DIR = $(PARROT_LIB_DIR)/library
HAS_ICU = @has_icu@
SHA1 = git log -1 --pretty=format:%H
SHA1 = `git log -1 --pretty=format:%H`
PERL = @perl@

HARNESS_WITH_FUDGE = $(PERL) t/harness -keep-exit-code --icu=$(HAS_ICU)
Expand Down Expand Up @@ -301,7 +301,7 @@ nqp-rx_test_run.tar.gz:
$(HARNESS_WITH_FUDGE_JOBS) 1 --archive nqp-rx_test_run.tar.gz --parrot_revision 1

smoke: nqp-rx_test_run.tar.gz
curl -F architecture=@cpuarch@ -F platform=@osname@ -F revision=$(SHA1) -F report_file=@nqp-rx_test_run.tar.gz -F username=parrot-autobot -F password=qa_rocks http://smolder.parrot.org/app/projects/process_add_report/8])"
curl -F architecture=@cpuarch@ -F platform=@osname@ -F revision=$(SHA1) -F report_file=@nqp-rx_test_run.tar.gz -F username=parrot-autobot -F password=qa_rocks http://smolder.parrot.org/app/projects/process_add_report/8

## cleaning

Expand Down
123 changes: 123 additions & 0 deletions t/harness
@@ -0,0 +1,123 @@
#! perl

# note: Due to a limitation in Getopt::Long options that should be passed
# through to fudgeall have to come after all other options

use strict;
use warnings;

use FindBin;
use File::Spec;
use Getopt::Long qw(:config pass_through);
use Pod::Usage;

my $slash = $^O eq 'MSWin32' ? '\\' : '/';
$ENV{'HARNESS_PERL'} = ".${slash}perl6";
use Test::Harness;
$Test::Harness::switches = '';

GetOptions(
'verbosity=i' => \$Test::Harness::verbose,
'jobs:1' => \my $jobs,
'icu:1' => \my $do_icu,
'long:1' => \my $do_long,
'stress:1' => \my $do_stress,
'archive=s' => \my $archive,
'parrot_revision=s' => \my $parrot_revision,
'help|h' => sub { pod2usage(1); },
) or pod2usage(2);

$do_long = 1 unless defined $do_long;
$do_stress = 0 unless defined $do_stress;

my @pass_through_options = grep m/^--?[^-]/, @ARGV;

my @tfiles = map { all_in($_) } qw(t/nqp);


my $tap_harness_class = 'TAP::Harness';
$tap_harness_class .= '::Archive' if $archive;

my $extra_properties;
if ($archive) {
$extra_properties->{'Parrot Revision'} = $parrot_revision
if $parrot_revision;
$extra_properties->{'Submitter'} = $ENV{SMOLDER_SUBMITTER}
if $ENV{SMOLDER_SUBMITTER};
}

if (eval "require $tap_harness_class;") {
my %harness_options = (
exec => ['./perl6'],
verbosity => 0+$Test::Harness::verbose,
jobs => $ENV{TEST_JOBS} || $jobs || 1,
ignore_exit => 1,
merge => 1,
$archive ? ( archive => $archive ) : (),
$extra_properties ? ( extra_properties => $extra_properties ) : (),
);
$tap_harness_class->new( \%harness_options )->runtests(@tfiles);
}
else {
runtests(@tfiles);
}

# adapted to return only files ending in '.t'
sub all_in {
my $start = shift;

return $start unless -d $start;

my @skip = ( File::Spec->updir, File::Spec->curdir, qw( .svn CVS .git ) );
my %skip = map {($_,1)} @skip;

my @hits = ();

if ( opendir( my $dh, $start ) ) {
my @files = sort readdir $dh;
closedir $dh or die $!;
for my $file ( @files ) {
next if $skip{$file};

my $currfile = File::Spec->catfile( $start, $file );
if ( -d $currfile ) {
push( @hits, all_in( $currfile ) );
} else {
push( @hits, $currfile ) if $currfile =~ /\.t$/;
}
}
} else {
warn "$start: $!\n";
}

return @hits;
}

sub fudge {
my $impl = 'rakudo';
my $cmd = join ' ', $^X, 't/spec/fudgeall',
@pass_through_options, $impl, @_;
return split ' ', `$cmd`;
}

=head1 NAME
t/harness - run the harness tests for Rakudo.
=head1 SYNOPSIS
t/harness [options] [files]
Options:
--help / -h - display the help message.
--tests-from-file=[filename] - get the tests from the filename.
--fudge - fudge (?)
--verbosity=[level] - set the verbosity level.
--jobs - number of jobs.
--icu - do icu.
--long - do long.
--stress - perform the stress tests/
--archive=[archive] - write to an archive.
--parrot_revision=[rev] - test with Parrot revision.

0 comments on commit 3fc8dc8

Please sign in to comment.