Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added roast-alike tests

  • Loading branch information...
commit 8a71fa11d779da3e75d270173bbd2f502885b555 1 parent 5b9b18e
@FROGGS FROGGS authored
Showing with 709 additions and 1 deletion.
  1. +22 −1 Makefile
  2. +22 −0 t/fudgeandrun
  3. +159 −0 t/harness
  4. +506 −0 t/spectest.data
View
23 Makefile
@@ -1,6 +1,14 @@
NQP = nqp
PARROT = parrot
-RM_F = perl -MExtUtils::Command -e rm_f
+PERL = perl
+RM_F = $(PERL) -MExtUtils::Command -e rm_f
+
+# We need to tweak that some day
+HAS_ICU = 0
+
+# NOTE: eventually, we should remove --keep-exit-code and --fudge
+# as the goal is that all tests must pass without fudge
+HARNESS_WITH_FUDGE = $(PERL) t/harness --fudge --keep-exit-code --icu=$(HAS_ICU)
all: blib/perl5.pbc
@@ -26,3 +34,16 @@ clean:
test:
PERL6LIB=blib prove -e perl6 t/v5/basic.t
+
+testable : all spectest_checkout spectest_update
+
+spectest_checkout : t/spec
+t/spec :
+ git clone git://github.com/rakudo-p5/roast5.git t/spec
+ -cd t/spec/ && git config remote.origin.pushurl git@github.com:rakudo-p5/roast5.git
+
+spectest_update :
+ -cd t/spec && git pull
+
+spectest: testable t/spectest.data
+ $(HARNESS_WITH_FUDGE) --tests-from-file=t/spectest.data
View
22 t/fudgeandrun
@@ -0,0 +1,22 @@
+#! /usr/bin/env perl
+use strict;
+use warnings;
+
+my @OPTS = ('--keep-exit-code', 'v5');
+
+if (@ARGV) {
+ my $file = $ARGV[0];
+ if (! -e $file) {
+ my $spec = "t/spec/$file";
+ if (-e $spec) {
+ $ARGV[0] = $spec;
+ }
+ }
+}
+
+my $nt = `t/spec/fudge @OPTS @ARGV`;
+# uninstalled rakudo doesn't know how to find Test.pm
+# ... or any other modules
+my $pwd = `pwd`; chomp $pwd;
+$ENV{PERL6LIB}="$pwd/blib:.";
+system("perl6", split ' ', $nt);
View
159 t/harness
@@ -0,0 +1,159 @@
+#! 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'} = "perl6";
+my $path_sep = $^O eq 'MSWin32' ? ';' : ':';
+$ENV{'PERL6LIB'} = join $path_sep, qw/ blib . /;
+use Test::Harness;
+$Test::Harness::switches = '';
+
+GetOptions(
+ 'tests-from-file=s' => \my $list_file,
+ 'fudge' => \my $do_fudge,
+ '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 @files = grep m/^[^-]/, @ARGV;
+
+if ($list_file) {
+ open(my $f, '<', $list_file)
+ or die "Can't open file '$list_file' for reading: $!";
+ while (<$f>) {
+ next if m/^\s*#/;
+ next unless m/\S/;
+ s/^\s+//;
+ s/\s+\z//;
+ my ($fn, $fudgespec) = split /\s+#\s*/;
+ if ($fudgespec) {
+ next if ($fudgespec =~ m/icu/) && !$do_icu;
+ next if ($fudgespec =~ m/long/) && !$do_long;
+ next if ($fudgespec =~ m/stress/) && !$do_stress;
+ }
+ $fn = "t/spec/$fn" unless $fn =~ m/^t\Q$slash\Espec\Q$slash\E/;
+ $fn =~ s{/}{$slash}g;
+ if ( -r $fn ) {
+ push @files, $fn;
+ } else {
+ warn "Missing test file: $fn\n";
+ }
+ }
+ close $f or die $!;
+}
+
+my @tfiles = map { all_in($_) } sort @files;
+
+if ($do_fudge) {
+ @tfiles = fudge(@tfiles);
+}
+
+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 => [$ENV{HARNESS_PERL}],
+ verbosity => 0+$Test::Harness::verbose,
+ jobs => $jobs || $ENV{TEST_JOBS} || 1,
+ ignore_exit => 1,
+ merge => 1,
+ $archive ? ( archive => $archive ) : (),
+ $extra_properties ? ( extra_properties => $extra_properties ) : (),
+ );
+ $tap_harness_class->new( \%harness_options )->runtests(@tfiles);
+}
+elsif ($archive) {
+ die "Can't load $tap_harness_class, which is needed for smolder submissions: $@";
+}
+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 = 'v5';
+ 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.
+
View
506 t/spectest.data
@@ -0,0 +1,506 @@
+# this is a list of all spec tests that are supposed to pass
+# on current v5.
+# empty lines and those beginning with a # are ignored
+
+base/cond.t
+base/if.t
+base/lex.t
+base/num.t
+base/pat.t
+base/rs.t
+base/term.t
+base/while.t
+
+benchmark/rt26188-speed-up-keys-on-empty-hash.t
+
+bigmem/read.t
+bigmem/vec.t
+
+cmd/elsif.t
+cmd/for.t
+cmd/lexsub.t
+cmd/mod.t
+cmd/subval.t
+cmd/switch.t
+cmd/while.t
+
+comp/bproto.t
+comp/cmdopt.t
+comp/colon.t
+comp/decl.t
+comp/final_line_num.t
+comp/fold.t
+comp/form_scope.t
+comp/hints.t
+comp/line_debug.t
+comp/multiline.t
+comp/opsubs.t
+comp/our.t
+comp/package_block.t
+comp/package.t
+comp/parser.t
+comp/proto.t
+comp/redef.t
+comp/require.t
+comp/retainedlines.t
+comp/term.t
+comp/uproto.t
+comp/use.t
+comp/utf.t
+
+io/argv.t
+io/binmode.t
+io/bom.t
+io/crlf.t
+io/crlf_through.t
+io/data.t
+io/defout.t
+io/dup.t
+io/eintr.t
+io/errnosig.t
+io/errno.t
+io/fflush.t
+io/fs.t
+io/inplace.t
+io/iofile.t
+io/iprefix.t
+io/layers.t
+io/nargv.t
+io/openpid.t
+io/open.t
+io/perlio_fail.t
+io/perlio_leaks.t
+io/perlio_open.t
+io/perlio.t
+io/pipe.t
+io/print.t
+io/pvbm.t
+io/read.t
+io/say.t
+io/shm.t
+io/tell.t
+io/through.t
+io/utf8.t
+
+japh/abigail.t
+
+lib/1_compile.t
+lib/commonsense.t
+lib/croak.t
+lib/cygwin.t
+lib/deprecate.t
+lib/mypragma.t
+lib/no_load.t
+lib/overload_fallback.t
+lib/overload_nomethod.t
+lib/proxy_constant_subs.t
+lib/universal.t
+
+mro/basic_01_c3.t
+mro/basic_01_c3_utf8.t
+mro/basic_01_dfs.t
+mro/basic_01_dfs_utf8.t
+mro/basic_02_c3.t
+mro/basic_02_c3_utf8.t
+mro/basic_02_dfs.t
+mro/basic_02_dfs_utf8.t
+mro/basic_03_c3.t
+mro/basic_03_c3_utf8.t
+mro/basic_03_dfs.t
+mro/basic_03_dfs_utf8.t
+mro/basic_04_c3.t
+mro/basic_04_c3_utf8.t
+mro/basic_04_dfs.t
+mro/basic_04_dfs_utf8.t
+mro/basic_05_c3.t
+mro/basic_05_c3_utf8.t
+mro/basic_05_dfs.t
+mro/basic_05_dfs_utf8.t
+mro/basic.t
+mro/basic_utf8.t
+mro/c3_with_overload.t
+mro/c3_with_overload_utf8.t
+mro/complex_c3.t
+mro/complex_c3_utf8.t
+mro/complex_dfs.t
+mro/complex_dfs_utf8.t
+mro/dbic_c3.t
+mro/dbic_c3_utf8.t
+mro/dbic_dfs.t
+mro/dbic_dfs_utf8.t
+mro/inconsistent_c3.t
+mro/inconsistent_c3_utf8.t
+mro/isa_aliases.t
+mro/isa_aliases_utf8.t
+mro/isa_c3.t
+mro/isa_c3_utf8.t
+mro/isa_dfs.t
+mro/isa_dfs_utf8.t
+mro/isarev.t
+mro/isarev_utf8.t
+mro/method_caching.t
+mro/method_caching_utf8.t
+mro/next_edgecases.t
+mro/next_edgecases_utf8.t
+mro/next_goto.t
+mro/next_goto_utf8.t
+mro/next_inanon.t
+mro/next_inanon_utf8.t
+mro/next_ineval.t
+mro/next_ineval_utf8.t
+mro/next_method.t
+mro/next_method_utf8.t
+mro/next_NEXT.t
+mro/next_NEXT_utf8.t
+mro/next_skip.t
+mro/next_skip_utf8.t
+mro/overload_c3.t
+mro/overload_c3_utf8.t
+mro/overload_dfs.t
+mro/package_aliases.t
+mro/package_aliases_utf8.t
+mro/pkg_gen.t
+mro/pkg_gen_utf8.t
+mro/recursion_c3.t
+mro/recursion_c3_utf8.t
+mro/recursion_dfs.t
+mro/recursion_dfs_utf8.t
+mro/vulcan_c3.t
+mro/vulcan_c3_utf8.t
+mro/vulcan_dfs.t
+mro/vulcan_dfs_utf8.t
+
+op/64bitint.t
+op/alarm.t
+op/anonsub.t
+op/append.t
+op/args.t
+op/array_base.t
+op/array.t
+op/assignwarn.t
+op/attrhand.t
+op/attrs.t
+op/auto.t
+op/avhv.t
+op/bless.t
+op/blocks.t
+op/bop.t
+op/caller.t
+op/chars.t
+op/chdir.t
+op/chop.t
+op/chr.t
+op/closure.t
+op/concat2.t
+op/cond.t
+op/context.t
+op/coreamp.t
+op/coresubs.t
+op/cproto.t
+op/crypt.t
+op/current_sub.t
+op/dbm.t
+op/defined.t
+op/defins.t
+op/delete.t
+op/die_except.t
+op/die_exit.t
+op/die_keeperr.t
+op/die.t
+op/die_unwind.t
+op/dor.t
+op/do.t
+op/each_array.t
+op/each.t
+op/evalbytes.t
+op/eval.t
+op/exec.t
+op/exists_sub.t
+op/exp.t
+op/fh.t
+op/filehandle.t
+op/filetest_stack_ok.t
+op/filetest.t
+op/filetest_t.t
+op/flip.t
+op/fork.t
+op/fresh_perl_utf8.t
+op/getpid.t
+op/getppid.t
+op/glob.t
+op/gmagic.t
+op/goto.t
+op/goto_xs.t
+op/grent.t
+op/grep.t
+op/groups.t
+op/gv.t
+op/hashassign.t
+op/hash-rt85026.t
+op/hash.t
+op/hashwarn.t
+op/heredoc.t
+op/inccode.t
+op/inccode-tie.t
+op/incfilter.t
+op/inc.t
+op/index.t
+op/index_thr.t
+op/int.t
+op/join.t
+op/kill0.t
+op/lc.t
+op/leaky-magic.t
+op/length.t
+op/lex_assign.t
+op/lex.t
+op/lfs.t
+op/list.t
+op/localref.t
+op/local.t
+op/lock.t
+op/loopctl.t
+op/lop.t
+op/magic-27839.t
+op/magic.t
+op/method.t
+op/mkdir.t
+op/mydef.t
+op/my_stash.t
+op/my.t
+op/negate.t
+op/not.t
+op/numconvert.t
+op/oct.t
+op/ord.t
+op/or.t
+op/overload_integer.t
+op/override.t
+op/packagev.t
+op/pack.t
+op/pos.t
+op/pow.t
+op/print.t
+op/protowarn.t
+op/push.t
+op/pwent.t
+op/qr.t
+op/quotemeta.t
+op/rand.t
+op/range.t
+op/readdir.t
+op/readline.t
+op/read.t
+op/recurse.t
+op/ref.t
+op/repeat.t
+op/require_37033.t
+op/require_errors.t
+op/reset.t
+op/reverse.t
+op/runlevel.t
+op/select.t
+op/setpgrpstack.t
+op/sigdispatch.t
+op/sigsystem.t
+op/sleep.t
+op/smartkve.t
+op/smartmatch.t
+op/sort.t
+op/splice.t
+op/split.t
+op/split_unicode.t
+op/sprintf2.t
+op/sprintf.t
+op/srand.t
+op/sselect.t
+op/stash.t
+op/state.t
+op/stat.t
+op/study.t
+op/studytied.t
+op/sub_lval.t
+op/substr.t
+op/substr_thr.t
+op/sub.t
+op/svleak.pl
+op/svleak.t
+op/switch.t
+op/symbolcache.t
+op/sysio.t
+op/taint.t
+op/threads-dirh.t
+op/threads.t
+op/tiearray.t
+op/tie_fetch_count.t
+op/tiehandle.t
+op/tie.t
+op/time_loop.t
+op/time.t
+op/tr.t
+op/undef.t
+op/universal.t
+op/unlink.t
+op/unshift.t
+op/upgrade.t
+op/utf8cache.t
+op/utf8decode.t
+op/utf8magic.t
+op/utfhash.t
+op/utftaint.t
+op/vec.t
+op/ver.t
+op/wantarray.t
+op/warn.t
+op/write.t
+op/yadayada.t
+
+opbasic/arith.t
+opbasic/cmp.t
+opbasic/concat.t
+opbasic/magic_phase.t
+opbasic/qq.t
+
+porting/args_assert.t
+porting/authors.t
+porting/bincompat.t
+porting/checkcase.t
+porting/checkcfgvar.t
+porting/cmp_version.t
+porting/customized.t
+porting/diag.t
+porting/dual-life.t
+porting/exec-bit.t
+porting/filenames.t
+porting/FindExt.t
+porting/globvar.t
+porting/maintainers.t
+porting/manifest.t
+porting/pending-author.t
+porting/perlfunc.t
+porting/podcheck.t
+porting/pod_rules.t
+porting/regen.t
+porting/test_bootstrap.t
+porting/utils.t
+
+re/charset.t
+re/fold_grind.t
+re/no_utf8_pm.t
+re/overload.t
+re/pat_advanced.t
+re/pat_advanced_thr.t
+re/pat_psycho.t
+re/pat_psycho_thr.t
+re/pat_re_eval.t
+re/pat_re_eval_thr.t
+re/pat_rt_report.t
+re/pat_rt_report_thr.t
+re/pat_special_cc.t
+re/pat_special_cc_thr.t
+re/pat.t
+re/pat_thr.t
+re/pos.t
+re/qr-72922.t
+re/qr_gc.t
+re/qrstack.t
+re/qr.t
+re/recompile.t
+re/reg_60508.t
+re/reg_email.t
+re/reg_email_thr.t
+re/reg_eval_scope.t
+re/reg_eval.t
+re/regexp_noamp.t
+re/regexp_notrie.t
+re/regexp_qr_embed.t
+re/regexp_qr_embed_thr.t
+re/regexp_qr.t
+re/regexp.t
+re/regexp_trielist.t
+re/regexp_unicode_prop.t
+re/regexp_unicode_prop_thr.t
+re/regex_sets_compat.t
+re/regex_sets.t
+re/reg_fold.t
+re/reg_mesg.t
+re/reg_namedcapture.t
+re/reg_nc_tie.t
+re/reg_pmod.t
+re/reg_posixcc.t
+re/re_tests
+re/rxcode.t
+re/subst_amp.t
+re/subst.t
+re/substT.t
+re/subst_wamp.t
+re/uniprops.t
+
+run/cloexec.t
+run/dtrace.t
+run/exit.t
+run/fresh_perl.t
+run/locale.t
+run/mad.t
+run/noswitch.t
+run/runenv.t
+run/script.t
+run/switch0.t
+run/switcha.t
+run/switchC.t
+run/switchd-78586.t
+run/switchd.t
+run/switches.t
+run/switchF1.t
+run/switchF.t
+run/switchI.t
+run/switchn.t
+run/switchp.t
+run/switcht.t
+run/switchx.t
+
+test_pl/can_isa_ok.t
+test_pl/_num_to_alpha.t
+test_pl/tempfile.t
+
+uni/attrs.t
+uni/bless.t
+uni/cache.t
+uni/caller.t
+uni/case.pl
+uni/chomp.t
+uni/chr.t
+uni/class.t
+uni/eval.t
+uni/fold.t
+uni/goto.t
+uni/greek.t
+uni/gv.t
+uni/labels.t
+uni/latin2.t
+uni/lex_utf8.t
+uni/lower.t
+uni/method.t
+uni/opcroak.t
+uni/overload.t
+uni/package.t
+uni/parser.t
+uni/readline.t
+uni/select.t
+uni/sprintf.t
+uni/stash.t
+uni/tie.t
+uni/title.t
+uni/tr_7jis.t
+uni/tr_eucjp.t
+uni/tr_sjis.t
+uni/tr_utf8.t
+uni/universal.t
+uni/upper.t
+uni/write.t
+
+win32/fs.t
+win32/runenv.t
+win32/system.t
+
+x2p/s2p.t
Please sign in to comment.
Something went wrong with that request. Please try again.