1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
Testing multiple samples with --tap
$ simple.c.bin --tap
TAP version 13
1..2
# Criterion v.* (re)
#
# Running 2 tests from misc
ok - misc::passing
not ok - misc::failing
---
assertions: 1
failures:
- simple.c:4: |+
Assertion failed: The expression 0 is false.
...
$ signal.c.bin --tap
TAP version 13
1..3
# Criterion v.* (re)
#
# Running 3 tests from simple
not ok - simple::wrong_signal
---
assertions: 0
failures:
...
not ok - simple::uncaught unexpected signal after signal.c:14
ok - simple::caught
$ asserts.c.bin --tap
TAP version 13
1..8
# Criterion v.* (re)
#
# Running 8 tests from asserts
ok - asserts::wstring
ok - asserts::string
ok - asserts::stream
not ok - asserts::old_school
---
assertions: 2
failures:
- asserts.c:19: |+
Assertion failed: (null)
- asserts.c:18: |+
Assertion failed: You can fail an assertion with a message from anywhere
...
ok - asserts::native
ok - asserts::float
not ok - asserts::base
---
assertions: 2
failures:
- asserts.c:13: |+
Assertion failed: This assert runs
- asserts.c:12: |+
Assertion failed: assert is fatal, expect isn't
...
ok - asserts::array
$ more-suites.c.bin --tap
TAP version 13
1..3
# Criterion v.* (re)
#
# Running 1 tests from suite2
ok - suite2::test
#
# Running 1 tests from suite1
ok - suite1::test
#
# Running 1 tests from disabled
ok - disabled::test # SKIP test was skipped
$ long-messages.c.bin --tap
TAP version 13
1..1
# Criterion v.* (re)
#
# Running 1 tests from sample
not ok - sample::long_msg
---
assertions: 1
failures:
- long-messages.c:4: |+
Assertion failed: This is
A long message
Spawning multiple lines.
Formatting is respected.
...
$ description.c.bin --tap
TAP version 13
1..2
# Criterion v.* (re)
#
# Running 2 tests from misc
ok - misc::skipped This one is skipped # SKIP test was skipped
not ok - misc::failing Just a failing test
---
assertions: 1
failures:
- description.c:4: |+
Assertion failed: The expression 0 is false.
...
Testing --output=tap
$ simple.c.bin --output=tap:-
TAP version 13
1..2
# Criterion v.* (re)
#
# Running 2 tests from misc
ok - misc::passing
not ok - misc::failing
---
assertions: 1
failures:
- simple.c:4: |+
Assertion failed: The expression 0 is false.
...
Testing CRITERION_OUTPUTS
$ CRITERION_OUTPUTS=tap:- simple.c.bin
TAP version 13
1..2
# Criterion v.* (re)
#
# Running 2 tests from misc
ok - misc::passing
not ok - misc::failing
---
assertions: 1
failures:
- simple.c:4: |+
Assertion failed: The expression 0 is false.
...
$ skip.c.bin --tap
TAP version 13
1..2
# Criterion v.* (re)
#
# Running 2 tests from misc
ok - misc::skipping # SKIP test was skipped
ok - misc::message # SKIP Skips may take printf-like messages
|