Skip to content

Commit

Permalink
Comment out a few small bits of Test.pm that causes us problems at th…
Browse files Browse the repository at this point in the history
…e moment. Now it compiles and seems to kinda work ('use Test; ok(1); done;' is fine).
  • Loading branch information
jnthn committed Jun 26, 2011
1 parent 4fbc478 commit 810c3b9
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ multi sub plan($number_of_tests) {
}
# Emit two successive timestamps to measure the measurment overhead,
# and to eliminate cacheing bias, if it exists, from the first test.
say '# t=' ~ pir::time__N if %*ENV{'PERL6_TEST_TIMES'};
say '# t=' ~ pir::time__N if %*ENV{'PERL6_TEST_TIMES'};
#say '# t=' ~ pir::time__N if %*ENV{'PERL6_TEST_TIMES'};
#say '# t=' ~ pir::time__N if %*ENV{'PERL6_TEST_TIMES'};
# Ideally the time readings above could be made with the expression
# now.to-posix[0], but the execution time showed by the difference
# between the two successive readings is far slower than when the
Expand Down Expand Up @@ -128,7 +128,9 @@ sub skip_rest($reason = '<unknown>') is export {
}

sub diag($message) is export {
say $message.subst(rx/^^/, '# ', :g);
# XXX No regexes yet in nom
#say $message.subst(rx/^^/, '# ', :g);
say "# " ~ $message;
}

proto sub flunk(|$) is export { * }
Expand All @@ -146,17 +148,18 @@ multi sub isa_ok(Mu $var, Mu $type, $msg) {

proto sub dies_ok(|$) is export { * }
multi sub dies_ok(Callable $closure, $reason) {
my $death = 0;
my $death = 1;
my $bad_death = 0;
try {
$closure();
CATCH {
$death = 1;
when / ^ 'Null PMC access ' / {
diag "wrong way to die: '$!'";
$bad_death = 1;
}
}
$death = 0;
# XXX no regexes, catch yet in nom
#CATCH {
#when / ^ 'Null PMC access ' / {
# diag "wrong way to die: '$!'";
# $bad_death = 1;
#}
#}
}
proclaim( $death && !$bad_death, $reason );
}
Expand All @@ -179,7 +182,8 @@ proto sub eval_dies_ok(|$) is export { * }
multi sub eval_dies_ok(Str $code, $reason) {
my $ee = eval_exception($code);
if defined $ee {
my $bad_death = "$ee" ~~ / ^ 'Null PMC access ' /;
# XXX no regexes yet in nom
my $bad_death = 0; #"$ee" ~~ / ^ 'Null PMC access ' /;
if $bad_death {
diag "wrong way to die: '$ee'";
}
Expand Down Expand Up @@ -243,7 +247,7 @@ sub proclaim($cond, $desc) {
print $todo_reason;
}
print "\n";
say '# t=' ~ pir::time__N if %*ENV{'PERL6_TEST_TIMES'};
#say '# t=' ~ pir::time__N if %*ENV{'PERL6_TEST_TIMES'};

if !$cond && $die_on_fail && !$todo_reason {
die "Test failed. Stopping test";
Expand Down

0 comments on commit 810c3b9

Please sign in to comment.