You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that our test coverage reports are overly optimistic: they report certain lines as hit, but the lines are actually not hit. We initially thought this was an issue in lcov (the coverage reporting tool), but it's actually due to gcov (the coverage measurement tool), which is part of the GCC toolchain.
It appears that clang/LLVM works better. @bensze01 writes:
Shows that llvm-cov also manifests some faulty behaviour:
it shows coverage for line 789 of x509.c, while the line isn't executed. gcov coverage works fine in this particular case:
Lcov using gcov on the other hand has some workarounds that seem to work fine (in the limited scope I investigated), but I haven't studied the impact when running all tests.
Run commands:
gcov version:
make CFLAGS='--coverage -g3 -O0' LDFLAGS=--coverage -C tests test_suite_x509parse
(cd tests && ./test_suite_x509parse)
make lcov
firefox Coverage/index.html
llvm-cov version:
make CC=clang-14 CFLAGS='--coverage -g3 -O0' LDFLAGS='--coverage' -C tests test_suite_x509parse
(cd tests && ./test_suite_x509parse)
make lcov GCOV_TOOL="llvm-cov-14 gcov"
diff generation (requires removing rm -f Coverage/tmp/*.info Coverage/tmp/descriptions line from lcov.sh first):
Results of coverage runs (and two diffs, llvm-cov vs updated gcov is what interests us): coverage_tests.tar.gz
Please note that the diff's LBC might also be inconsistent, as shown here.
It seems that for some reason it's hard to get flawless results with our code. Bugs in tools? Any options that we don't use, and we should? I don't have the answers for now.
It appears that our test coverage reports are overly optimistic: they report certain lines as hit, but the lines are actually not hit. We initially thought this was an issue in lcov (the coverage reporting tool), but it's actually due to
gcov
(the coverage measurement tool), which is part of the GCC toolchain.It appears that clang/LLVM works better. @bensze01 writes:
The goal of this task is to investigate the coverage measurement differences between different versions of GCC and LLVM. In particular:
If LLVM is more reliable than GCC, we'll switch our scripts to use it.
The text was updated successfully, but these errors were encountered: