~ubuntu-branches/ubuntu/vivid/nqp/vivid-proposed

« back to all changes in this revision

Viewing changes to src/core/testing.nqp

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2013-11-01 12:09:18 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20131101120918-kx51sl0sxl3exsxi
Tags: 2013.10-1
* New upstream release
* Bump versioned (Build-)Depends on parrot
* Update patches
* Install new README.pod
* Fix vcs-field-not-canonical
* Do not install rubyish examples
* Do not Depends on parrot-devel anymore
* Add 07_disable-serialization-tests.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
my $test_counter       := 0;
 
2
my $todo_upto_test_num := 0;
 
3
my $todo_reason        := '';
 
4
 
 
5
sub plan($quantity) {
 
6
    say("1..$quantity");
 
7
}
 
8
 
 
9
sub ok($condition, $desc?) {
 
10
    $test_counter := $test_counter + 1;
 
11
 
 
12
    unless $condition {
 
13
        print("not ");
 
14
    }
 
15
    print("ok $test_counter");
 
16
    if $desc {
 
17
        print(" - $desc");
 
18
    }
 
19
    if $test_counter <= $todo_upto_test_num {
 
20
        print($todo_reason);
 
21
    }
 
22
    print("\n");
 
23
    
 
24
    $condition ?? 1 !! 0
 
25
}
 
26
 
 
27
sub todo($reason, $count) {
 
28
    $todo_upto_test_num := $test_counter + $count;
 
29
    $todo_reason        := "# TODO $reason";
 
30
}
 
31
 
 
32
sub skip($desc) {
 
33
    $test_counter := $test_counter + 1;
 
34
    say("ok $test_counter # SKIP $desc\n");
 
35
}
 
36
 
 
37
# vim: ft=perl6