The eleventh batch
[alt-git.git] / t / t0080-unit-test-output.sh
blob3c369c88e2a416fa53c8ea8e8af135a26316251a
1 #!/bin/sh
3 test_description='Test the output of the unit test framework'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success 'TAP output from unit tests' - <<\EOT
9 cat >expect <<-EOF &&
10 # BUG: check outside of test at t/helper/test-example-tap.c:75
11 ok 1 - passing test
12 ok 2 - passing test and assertion return 1
13 # check "1 == 2" failed at t/helper/test-example-tap.c:79
14 # left: 1
15 # right: 2
16 not ok 3 - failing test
17 ok 4 - failing test and assertion return 0
18 not ok 5 - passing TEST_TODO() # TODO
19 ok 6 - passing TEST_TODO() returns 1
20 # todo check 'check(x)' succeeded at t/helper/test-example-tap.c:26
21 not ok 7 - failing TEST_TODO()
22 ok 8 - failing TEST_TODO() returns 0
23 # check "0" failed at t/helper/test-example-tap.c:31
24 # skipping test - missing prerequisite
25 # skipping check '1' at t/helper/test-example-tap.c:33
26 ok 9 - test_skip() # SKIP
27 ok 10 - skipped test returns 1
28 # skipping test - missing prerequisite
29 ok 11 - test_skip() inside TEST_TODO() # SKIP
30 ok 12 - test_skip() inside TEST_TODO() returns 1
31 # check "0" failed at t/helper/test-example-tap.c:49
32 not ok 13 - TEST_TODO() after failing check
33 ok 14 - TEST_TODO() after failing check returns 0
34 # check "0" failed at t/helper/test-example-tap.c:57
35 not ok 15 - failing check after TEST_TODO()
36 ok 16 - failing check after TEST_TODO() returns 0
37 # check "!strcmp("\thello\\\\", "there\"\n")" failed at t/helper/test-example-tap.c:62
38 # left: "\011hello\\\\"
39 # right: "there\"\012"
40 # check "!strcmp("NULL", NULL)" failed at t/helper/test-example-tap.c:63
41 # left: "NULL"
42 # right: NULL
43 # check "'a' == '\n'" failed at t/helper/test-example-tap.c:64
44 # left: 'a'
45 # right: '\012'
46 # check "'\\\\' == '\\''" failed at t/helper/test-example-tap.c:65
47 # left: '\\\\'
48 # right: '\\''
49 not ok 17 - messages from failing string and char comparison
50 # BUG: test has no checks at t/helper/test-example-tap.c:94
51 not ok 18 - test with no checks
52 ok 19 - test with no checks returns 0
53 ok 20 - if_test passing test
54 # check "1 == 2" failed at t/helper/test-example-tap.c:100
55 # left: 1
56 # right: 2
57 not ok 21 - if_test failing test
58 not ok 22 - if_test passing TEST_TODO() # TODO
59 # todo check 'check(1)' succeeded at t/helper/test-example-tap.c:104
60 not ok 23 - if_test failing TEST_TODO()
61 # check "0" failed at t/helper/test-example-tap.c:106
62 # skipping test - missing prerequisite
63 # skipping check '1' at t/helper/test-example-tap.c:108
64 ok 24 - if_test test_skip() # SKIP
65 # skipping test - missing prerequisite
66 ok 25 - if_test test_skip() inside TEST_TODO() # SKIP
67 # check "0" failed at t/helper/test-example-tap.c:113
68 not ok 26 - if_test TEST_TODO() after failing check
69 # check "0" failed at t/helper/test-example-tap.c:119
70 not ok 27 - if_test failing check after TEST_TODO()
71 # check "!strcmp("\thello\\\\", "there\"\n")" failed at t/helper/test-example-tap.c:122
72 # left: "\011hello\\\\"
73 # right: "there\"\012"
74 # check "!strcmp("NULL", NULL)" failed at t/helper/test-example-tap.c:123
75 # left: "NULL"
76 # right: NULL
77 # check "'a' == '\n'" failed at t/helper/test-example-tap.c:124
78 # left: 'a'
79 # right: '\012'
80 # check "'\\\\' == '\\''" failed at t/helper/test-example-tap.c:125
81 # left: '\\\\'
82 # right: '\\''
83 not ok 28 - if_test messages from failing string and char comparison
84 # BUG: test has no checks at t/helper/test-example-tap.c:127
85 not ok 29 - if_test test with no checks
86 1..29
87 EOF
89 ! test-tool example-tap >actual &&
90 test_cmp expect actual
91 EOT
93 test_done