[go: up one dir, main page]

File: core.t

package info (click to toggle)
criterion 2.3.3git1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,832 kB
  • sloc: ansic: 17,852; cpp: 795; python: 72; sh: 27; makefile: 23
file content (138 lines) | stat: -rw-r--r-- 3,404 bytes parent folder | download | duplicates (2)
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
Checking the version

  $ simple.c.bin --version
  Tests compiled with Criterion v.* (re)

Running the simplest test

  $ simple.c.bin
  [----] simple.c:4: Assertion Failed
  [----]   
  [----]   The expression 0 is false.
  [----]   
  [FAIL] misc::failing
  [====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0 

Running with verbose output

  $ simple.c.bin --verbose
  \[----\] Criterion v.* (re)
  [====] Running 2 tests from misc:
  [RUN ] misc::failing
  [----] simple.c:4: Assertion Failed
  [----]   
  [----]   The expression 0 is false.
  [----]   
  [FAIL] misc::failing
  [RUN ] misc::passing
  [PASS] misc::passing
  [====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0 

Listing the tests

  $ simple.c.bin --list
  misc: 2 tests
  |-- failing
  `-- passing

Testing the fixtures

  $ fixtures.c.bin
  Runs before the test
  Runs after the test
  [====] Synthesis: Tested: 1 | Passing: 1 | Failing: 0 | Crashing: 0 

Testing descriptions

  $ description.c.bin --verbose
  \[----\] Criterion v.* (re)
  [====] Running 2 tests from misc:
  [RUN ] misc::failing
  [----]   Just a failing test
  [----] description.c:4: Assertion Failed
  [----]   
  [----]   The expression 0 is false.
  [----]   
  [FAIL] misc::failing
  [SKIP] misc::skipped: Test is disabled
  [----]   This one is skipped
  [====] Synthesis: Tested: 1 | Passing: 0 | Failing: 1 | Crashing: 0 

Testing report hooks

  $ report.c.bin
  criterion_init
  testing test in category sample
  [----] report.c:5: Assertion Failed
  [----]   
  [----]   The expression 0 is false.
  [----]   
  Asserts: [1 passed, 1 failed, 2 total]
  [FAIL] sample::test
  criterion_fini
  [====] Synthesis: Tested: 1 | Passing: 0 | Failing: 1 | Crashing: 0 

C++ equivalents

  $ [ "$CXX_SUPPORT" = 1 ] || exit 80

  $ simple.cc.bin --version
  Tests compiled with Criterion v.* (re)

  $ simple.cc.bin
  [----] simple.cc:4: Assertion Failed
  [----]   
  [----]   The expression 0 is false.
  [----]   
  [FAIL] misc::failing
  [====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0 

  $ simple.cc.bin --verbose
  \[----\] Criterion v.* (re)
  [====] Running 2 tests from misc:
  [RUN ] misc::failing
  [----] simple.cc:4: Assertion Failed
  [----]   
  [----]   The expression 0 is false.
  [----]   
  [FAIL] misc::failing
  [RUN ] misc::passing
  [PASS] misc::passing
  [====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0 

  $ simple.cc.bin --list
  misc: 2 tests
  |-- failing
  `-- passing

  $ fixtures.cc.bin
  Runs before the test
  Runs after the test
  [====] Synthesis: Tested: 1 | Passing: 1 | Failing: 0 | Crashing: 0 

  $ description.cc.bin --verbose
  \[----\] Criterion v.* (re)
  [====] Running 2 tests from misc:
  [RUN ] misc::failing
  [----]   Just a failing test
  [----] description.cc:4: Assertion Failed
  [----]   
  [----]   The expression 0 is false.
  [----]   
  [FAIL] misc::failing
  [SKIP] misc::skipped: Test is disabled
  [----]   This one is skipped
  [====] Synthesis: Tested: 1 | Passing: 0 | Failing: 1 | Crashing: 0 

  $ report.cc.bin
  criterion_init
  testing test in category sample
  [----] report.cc:5: Assertion Failed
  [----]   
  [----]   The expression 0 is false.
  [----]   
  Asserts: [1 passed, 1 failed, 2 total]
  [FAIL] sample::test
  criterion_fini
  [====] Synthesis: Tested: 1 | Passing: 0 | Failing: 1 | Crashing: 0