Permalink
Browse files

[rakudo]: Allow single-test make targets, refactor fudge/harness.

* Patch courtesy Schwern++.


git-svn-id: http://svn.perl.org/parrot/trunk/languages/perl6@29782 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 16b0689 commit 65382bce2266ab3d3b381406f475efe651d2ef6e @pmichaud pmichaud committed Jul 27, 2008
Showing with 60 additions and 71 deletions.
  1. +16 −11 config/makefiles/root.in
  2. +6 −22 t/harness
  3. +38 −38 t/spectest_regression.data
@@ -189,26 +189,31 @@ testtest: all test
# 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
+
spectest: all t/spec
-cd t/spec && svn up
- $(PERL) t/harness --fudge --keep-exit-code t/spec
+ $(HARNESS_WITH_FUDGE) t/spec
+# Run the spectests that we know work.
spectest_regression: all t/spec t/spectest_regression.data
-cd t/spec && svn up
- $(PERL) t/harness \
- --configfudge \
- --tests-from-file=t/spectest_regression.data \
- --keep-exit-code \
- t/spec/ \
+ $(HARNESS_WITH_FUDGE) --tests-from-file=t/spectest_regression.data
fulltest: coretest spectest_regression codetest
+# Run the tests in t/localtest.data
localtest: all t/spec t/localtest.data
- $(PERL) t/harness \
- --configfudge \
- --tests-from-file=t/localtest.data \
- --keep-exit-code \
- t/spec/ \
+ @$(HARNESS_WITH_FUDGE) --tests-from-file=t/localtest.data
+
+# Run many tests of your choise.
+# make somtests TESTFILES=t/foo/bar
+sometests: all
+ @$(HARNESS_WITH_FUDGE) $(TESTFILES)
+
+# Run a single test
+t/*.t t/*/*.t t/*/*/*.t: all
+ @$(HARNESS_WITH_FUDGE) $@
t/localtest.data:
$(PERL) -MExtUtils::Command -e test_f $@
View
@@ -22,15 +22,14 @@ our %harness_args = (
GetOptions(
'tests-from-file=s' => \my $list_file,
'fudge' => \my $do_fudge,
- 'configfudge' => \my $configfudge,
);
my @pass_through_options = grep m/^--?[^-]/, @ARGV;
my @files = grep m/^[^-]/, @ARGV;
my %accepted_tests;
-if ($list_file || $configfudge) {
+if ($list_file) {
open(my $f, '<', $list_file)
or die "Can't open file '$list_file' for reading: $!";
my $slash = $^O eq 'MSWin32' ? '\\' : '/';
@@ -42,7 +41,7 @@ if ($list_file || $configfudge) {
$fn = "t/spec/$fn" unless $fn =~ m/^t\Q$slash\Espec\Q$slash\E/;
$fn =~ s/\//$slash/g;
if( -r $fn ) {
- $accepted_tests{$fn} = $fudgespec;
+ push @files, $fn;
} else {
warn "Missing test file: $fn\n";
}
@@ -51,26 +50,11 @@ if ($list_file || $configfudge) {
}
# first prepare our list of files
-my @tfiles =
- map { all_in($_) } sort ( $list_file ? keys %accepted_tests : @files );
+my @tfiles = map { all_in($_) } sort @files;
# then decide if and what to fudge
-if (defined($do_fudge) || defined($configfudge)){
- if ($do_fudge){
- @tfiles = fudge(@tfiles);
- } else {
- my (@fudge, @nofudge);
- for (@tfiles){
- if ($accepted_tests{$_} =~ m/^pure$/){
- push @nofudge, $_;
- } else {
- push @fudge, $_;
- }
- }
- if (@fudge) {
- @tfiles = sort @nofudge, fudge(@fudge);
- }
- }
+if ($do_fudge) {
+ @tfiles = fudge(@tfiles);
}
$harness_args{arguments} = \@tfiles;
@@ -79,7 +63,7 @@ sub fudge {
my $impl = 'rakudo';
my $cmd = join ' ', $^X, 't/spec/fudgeall',
@pass_through_options, $impl, @_;
- print "$cmd\n";
+# print "$cmd\n";
return split ' ', `$cmd`;
}
@@ -6,79 +6,79 @@ S02-builtin_data_types/anon_block.t
S02-builtin_data_types/array_extending.t
S02-builtin_data_types/array.t
S02-builtin_data_types/flattening.t
-S02-builtin_data_types/nested_arrays.t # pure
-S02-builtin_data_types/nested_pairs.t # pure
+S02-builtin_data_types/nested_arrays.t
+S02-builtin_data_types/nested_pairs.t
S02-builtin_data_types/num.t
S02-builtin_data_types/range.t
S02-builtin_data_types/type.t
S02-literals/autoref.t
-S02-literals/hex_chars.t # pure
+S02-literals/hex_chars.t
S02-literals/radix.t
-S02-magicals/dollar-underscore.t # pure
+S02-magicals/dollar-underscore.t
S02-names_and_variables/perl.t
-S02-polymorphic_types/subset-code.t # pure
+S02-polymorphic_types/subset-code.t
S02-polymorphic_types/subset-range.t
S02-whitespace_and_comments/one-pass-parsing.t
S03-operators/arith.t
S03-operators/assign-is-not-binding.t
-S03-operators/autoincrement.t # pure
+S03-operators/autoincrement.t
S03-operators/comparison.t
S03-operators/context.t
S03-operators/cross-metaop.t
-S03-operators/equality.t # pure
-S03-operators/not.t # pure
+S03-operators/equality.t
+S03-operators/not.t
S03-operators/numeric-context.t
S03-operators/range.t
-S03-operators/relational.t # pure
+S03-operators/relational.t
S03-operators/repeat.t
S03-operators/ternary.t
S03-operators/short-circuit.t
-S03-operators/true.t # pure
+S03-operators/true.t
S03-junctions/misc.t
S04-declarations/multiple.t
S04-declarations/my.t
-S04-declarations/implicit-parameter.t # pure
+S04-declarations/implicit-parameter.t
S04-statements/do.t
S04-statements/for.t
S04-statements/given.t
S04-statements/no-implicit-block.t
S04-statements/repeat.t
S04-statements/return.t
-S04-statements/terminator.t # pure
+S04-statements/terminator.t
S04-statements/try.t
-S04-statements/until.t # pure
+S04-statements/until.t
S04-statements/while.t
S05-metasyntax/changed.t
S05-metasyntax/regex.t
-S05-metasyntax/unknown.t # pure
+S05-metasyntax/unknown.t
S05-transliteration/trans.t
-S06-multi/syntax.t # pure
-S06-signature/mixed-placeholders.t # pure
+S06-multi/syntax.t
+S06-signature/mixed-placeholders.t
S06-signature/named-parameters.t
-S06-signature/named-placeholders.t # pure
-S06-signature/positional-placeholders.t # pure
-S06-signature/slurpy-placeholders.t # pure
-S06-traits/is-copy.t # pure
+S06-signature/named-placeholders.t
+S06-signature/positional-placeholders.t
+S06-signature/slurpy-placeholders.t
+S06-traits/is-copy.t
S06-traits/is-rw.t
-S12-attributes/class.t # pure
-S12-class/anonymous.t # pure
-S12-class/attributes.t # pure
+S12-attributes/class.t
+S12-class/anonymous.t
+S12-class/attributes.t
S12-class/inheritance.t
S12-class/inheritance-class-methods.t
-S12-class/instantiate.t # pure
-S12-class/parent_attributes.t # pure
-S12-enums/as-role.t # pure
-S12-methods/calling_syntax.t # pure
+S12-class/instantiate.t
+S12-class/parent_attributes.t
+S12-enums/as-role.t
+S12-methods/calling_syntax.t
S12-role/attributes.t
-S12-role/composition.t # pure
-S12-role/mixin.t # pure
+S12-role/composition.t
+S12-role/mixin.t
S16-io/say.t
-S29-any/cmp.t # pure
+S29-any/cmp.t
S29-array/delete.t
-S29-array/exists.t # pure
-S29-array/keys_values.t # pure
-S29-array/kv.t # pure
-S29-array/pairs.t # pure
+S29-array/exists.t
+S29-array/keys_values.t
+S29-array/kv.t
+S29-array/pairs.t
S29-array/pop.t
S29-array/push.t
S29-array/shift.t
@@ -89,23 +89,23 @@ S29-list/join.t
S29-list/map_empty_list.t
S29-list/map_flattening.t
S29-list/map_function_return_values.t
-S29-list/map_topic.t # pure
+S29-list/map_topic.t
S29-list/map.t
S29-list/minmax.t
-S29-list/mutating_listops.t # pure
+S29-list/mutating_listops.t
S29-list/reduce.t
S29-list/reverse.t
S29-list/sort.t
S29-num/abs.t
-S29-num/complex.t # pure
+S29-num/complex.t
S29-num/exp.t
S29-num/int.t
S29-num/log.t
S29-num/pi.t
S29-num/rand.t
S29-num/sign.t
S29-num/sqrt.t
-S29-str/append.t # pure
+S29-str/append.t
S29-str/capitalize.t
S29-str/chop.t
S29-str/index.t

0 comments on commit 65382bc

Please sign in to comment.