Skip to content

Commit

Permalink
Revert "Fix duplicate test count id"
Browse files Browse the repository at this point in the history
This reverts commit c19e810.

`my int $x = cas ...` gives a "machine's native size" error
on a 32 bit system. And since there is no atomics in JVM yet
we don't want to use them here (yet).
See: https://irclog.perlgeek.de/perl6-dev/2017-08-30#i_15090989
  • Loading branch information
ugexe committed Aug 30, 2017
1 parent f1b0863 commit 3e13825
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/Test.pm6
Expand Up @@ -675,16 +675,16 @@ sub eval_exception($code) {
sub proclaim(Bool(Mu) $cond, $desc is copy, $unescaped-prefix = '') {
_init_io() unless $output;
# exclude the time spent in proclaim from the test time
my $current_tests_run = cas $num_of_tests_run, -> $i { $i + 1 };
$num_of_tests_run = $num_of_tests_run + 1;

my $tap = $indents;
unless $cond {
$tap ~= "not ";

cas( $num_of_tests_failed, -> $i { $i + 1 } )
unless $current_tests_run <= $todo_upto_test_num;
$num_of_tests_failed = $num_of_tests_failed + 1
unless $num_of_tests_run <= $todo_upto_test_num;

cas( $pseudo_fails, -> $i { $i + 1 } ) if $subtest_todo_reason;
$pseudo_fails = $pseudo_fails + 1 if $subtest_todo_reason;
}

# TAP parsers do not like '#' in the description, they'd miss the '# TODO'
Expand All @@ -696,11 +696,11 @@ sub proclaim(Bool(Mu) $cond, $desc is copy, $unescaped-prefix = '') {
nqp::split('#', $desc.Str))))
!! '';

$tap ~= $todo_reason && $current_tests_run <= $todo_upto_test_num
?? "ok $current_tests_run - $unescaped-prefix$desc$todo_reason"
$tap ~= $todo_reason && $num_of_tests_run <= $todo_upto_test_num
?? "ok $num_of_tests_run - $unescaped-prefix$desc$todo_reason"
!! (! $cond && $subtest_todo_reason)
?? "ok $current_tests_run - $unescaped-prefix$desc$subtest_todo_reason"
!! "ok $current_tests_run - $unescaped-prefix$desc";
?? "ok $num_of_tests_run - $unescaped-prefix$desc$subtest_todo_reason"
!! "ok $num_of_tests_run - $unescaped-prefix$desc";

$tap ~= ("\n$indents# t=" ~ ceiling(($time_after - $time_before)*1_000_000))
if nqp::iseq_i($perl6_test_times,1);
Expand Down

0 comments on commit 3e13825

Please sign in to comment.