gcov | expcov |
---|---|
![]() |
![]() |
Component | Spec. |
CPU | Intel® Xeon® Processor |
OS | Linux 5.15 (Ubuntu) |
Memory | 1GB |
Compiler | expcov based on clang 14.0.5 |
Item | Limits |
Source file | 1 file |
Processing time | 5 seconds |
Memory allocation | 8MB |
File generation | 1MB |
System calls | Disallow fork, exec, mkdir, socket, ... |
Function | Disable SIGSEGV/SIGBUS detection |
Appearance | Meaning |
---|---|
a = b | The expression was executed. |
a = b | The expression was not executed. |
a = b | Excluded expression from code coverage. |
a < b |
The expression was executed. The result was ever been set to true once or more. The result was ever been set to false once or more. |
a < b |
The expression was executed. The result was ever been set to true once or more. The result was never been set to false. |
a < b |
The expression was executed. The result has never been set to true. The result was ever been set to false once or more. |
a < b |
The expression was not executed. |
Appearance | Meaning |
---|---|
a < 0 && b < 1 |
for example: a = 1, b = 2 The expression a < 0 was executed. a was ever greater than or equal to 0 once or more. If the value on the left side of logical-and is false, this expression affects the decision independently. a was never been less than 0. The expression && was executed. The decision's outcome was never been set to true. The decision's outcome was ever been set to false once or more. The expression b < 1 was not executed due to short circuit evaluation. |
a < 0 && b < 1 |
for example: a = -1, b = 2 The expression a < 0 was executed. a was ever less than 0 once or more. a was never been greater than or equal to 0. The expression && was executed. The decision's outcome was never been set to true. The decision's outcome was ever been set to false once or more. The expression b < 1 was executed. b was ever greater than or equal to 1 once or more. If the value on the left side of logical-and is true, right side of logical-and evaluated as false affects the decision independently. b was never been less than 1. |
a < 0 && b < 1 |
for example: a = -1, b = 0 The expression a < 0 was executed. a was ever less than 0 once or more. If the value on the right side of logical-and is true, left side of logical-and evaluated as true affects the decision independently. a was never been greater than or equal to 0. The expression && was executed. The decision's outcome was ever been set to true once or more. The decision's outcome was never been set to false. The expression b < 1 was executed. b was ever been less than 1 once or more. If the value on the left side of logical-and is true, right side of logical-and evaluated as true affects the decision independently. b was never greater than or equal to 1. |
a < 0 && b < 1 | All patterns covered, MC/DC was satisfied. |
Appearance | Meaning |
---|---|
a < 0 || b < 1 |
for example: a = -1, b = 2 The expression a < 0 was executed. a was ever less than 0 once or more. The value true on the left side of logical-or affects the decision independently. a was never been greater than or equal to 0. The expression || was executed. The decision's outcome was ever been set to true once or more. The decision's outcome was never been set to false. The expression b < 1 was not executed due to short circuit evaluation. |
a < 0 || b < 1 |
for example: a = 1, b = 2 The expression a < 0 was executed. a was ever greater than or equal to 0 once or more. If the value on the right side of logical-or is false, left side of logical-or evaluated as false affects the decision independently. a was never been less than 0. The expression || was executed. The decision's outcome was never been set to true. The decision's outcome was ever been set to false once or more. The expression b < 1 was executed. b was ever greater than or equal to 1 once or more. If the value on the left side of logical-or is false, right side of logical-or evaluated as false affects the decision independently. b was never been less than 1. |
a < 0 || b < 1 |
for example: a = 1, b = 0 The expression a < 0 was executed. a was ever greater than or equal to 0 once or more. a was never been less than 0. The expression || was executed. The decision's outcome was ever been set to true once or more. The decision's outcome was never been set to false. The expression b < 1 was executed. b was ever less than 1 once or more. If the value on the left side of logical-or is false, right side of logical-or evaluated as true affects the decision independently. b was never been greater than or equal to 1. |
a < 0 || b < 1 | All patterns covered, MC/DC was satisfied. |
gcov | expcov |
---|---|
![]() |
![]() |
Compiler | gcc 4.8.2 | gcc 4.8.2 | gcc 4.8.2 | gcc 4.8.2 | clang 3.2 | clang 3.2 | expcov(clang) | expcov(clang) | expcov(clang) | expcov(clang) |
Optimize | ✔ | ✔ | ✔ | ✔ | ✔ | |||||
Coverage | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||||
Multi-thread suport | ✔ | ✔ | ||||||||
Compile option |
|
|
|
-O2 |
|
|
|
|
||
Metrics | - | - |
|
|
- | - |
|
|
|
|
Dhrystone(1.1) Core2 Duo 2.66GHz |
6289473 | 28571428 | 6172996 | 23255813 | 5272439 | 30303030 | 330943 | 416614 | 1888163 | 5825286 |
Speed | 100.00% | 454.27% | 98.14% | 369.75% | 83.82% | 481.80% | 5.26% | 6.62% | 30.02% | 92.61% |
#include <stdio.h> void message() { printf("Hello, world\n"); }
#include <stdio.h> void message(); int main(int argc, char *argv[]) { message(); return 0; }
clang --expcov -c test1.c clang --expcov -c test2.c
clang --expcov test1.o test2.o -o test
./testThe program 'test' generates coverage data file 'test.cov' when exit.
EXPCOV_REPORT=1 ./testThe program 'test' generates HTML reports and exit program immediately;
Features | expcov | gcov | lcov |
---|---|---|---|
Coverage unit | Expression | Line | Line |
Compiler | clang-based | gcc | gcc |
Library | libexpcov | libgcov | libgcov |
Coverage data file | appname + .cov (1 file) | sourcename + .gcno sourcename + .gcda | sourcename + .gcno sourcename + .gcda |
Bit width of counter | 64bit | 32bit | 32bit |
Report format | HTML | Plain text | HTML |
C0 metrics | ✔ | ✔ | ✔ |
C1 metrics | ✔ | ✔ | ✔ |
C2 metrics | - | - | - |
MC/DC metrics | ✔ | - | - |
Threading support | ✔ | - | - |
Enter/Leave analysis | ✔ | - | - |
SIGSEGV/SIGBUS detection | ✔ | - | - |
Separation of the last result | ✔ | - | - |