]> git.ipfire.org Git - thirdparty/git.git/blob - t/t0080-unit-test-output.sh
Merge branch 'vd/fsck-submodule-url-test'
[thirdparty/git.git] / t / t0080-unit-test-output.sh
1 #!/bin/sh
2
3 test_description='Test the output of the unit test framework'
4
5 . ./test-lib.sh
6
7 test_expect_success 'TAP output from unit tests' '
8 cat >expect <<-EOF &&
9 ok 1 - passing test
10 ok 2 - passing test and assertion return 1
11 # check "1 == 2" failed at t/unit-tests/t-basic.c:76
12 # left: 1
13 # right: 2
14 not ok 3 - failing test
15 ok 4 - failing test and assertion return 0
16 not ok 5 - passing TEST_TODO() # TODO
17 ok 6 - passing TEST_TODO() returns 1
18 # todo check ${SQ}check(x)${SQ} succeeded at t/unit-tests/t-basic.c:25
19 not ok 7 - failing TEST_TODO()
20 ok 8 - failing TEST_TODO() returns 0
21 # check "0" failed at t/unit-tests/t-basic.c:30
22 # skipping test - missing prerequisite
23 # skipping check ${SQ}1${SQ} at t/unit-tests/t-basic.c:32
24 ok 9 - test_skip() # SKIP
25 ok 10 - skipped test returns 1
26 # skipping test - missing prerequisite
27 ok 11 - test_skip() inside TEST_TODO() # SKIP
28 ok 12 - test_skip() inside TEST_TODO() returns 1
29 # check "0" failed at t/unit-tests/t-basic.c:48
30 not ok 13 - TEST_TODO() after failing check
31 ok 14 - TEST_TODO() after failing check returns 0
32 # check "0" failed at t/unit-tests/t-basic.c:56
33 not ok 15 - failing check after TEST_TODO()
34 ok 16 - failing check after TEST_TODO() returns 0
35 # check "!strcmp("\thello\\\\", "there\"\n")" failed at t/unit-tests/t-basic.c:61
36 # left: "\011hello\\\\"
37 # right: "there\"\012"
38 # check "!strcmp("NULL", NULL)" failed at t/unit-tests/t-basic.c:62
39 # left: "NULL"
40 # right: NULL
41 # check "${SQ}a${SQ} == ${SQ}\n${SQ}" failed at t/unit-tests/t-basic.c:63
42 # left: ${SQ}a${SQ}
43 # right: ${SQ}\012${SQ}
44 # check "${SQ}\\\\${SQ} == ${SQ}\\${SQ}${SQ}" failed at t/unit-tests/t-basic.c:64
45 # left: ${SQ}\\\\${SQ}
46 # right: ${SQ}\\${SQ}${SQ}
47 not ok 17 - messages from failing string and char comparison
48 # BUG: test has no checks at t/unit-tests/t-basic.c:91
49 not ok 18 - test with no checks
50 ok 19 - test with no checks returns 0
51 1..19
52 EOF
53
54 ! "$GIT_BUILD_DIR"/t/unit-tests/bin/t-basic >actual &&
55 test_cmp expect actual
56 '
57
58 test_done