Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Unit Testing #25

Open
7 tasks
jsallay opened this issue Jan 6, 2022 · 1 comment
Open
7 tasks

Improve Unit Testing #25

jsallay opened this issue Jan 6, 2022 · 1 comment

Comments

@jsallay
Copy link
Collaborator

jsallay commented Jan 6, 2022

We have quite a few unit tests, but I am confident that there are several corner cases missing.

As part of this we should:

  • Add in code coverage checks
  • Try for 100% code coverage in unit tests
    • base
    • vector
    • scalar
    • string
    • map
    • wrap (operator<< and operator==)
@mormj
Copy link
Contributor

mormj commented Jan 24, 2022

Meson has built-in coverage testing if you install gcovr

https://mesonbuild.com/Unit-tests.html#coverage

This produces a report (based on a running of ninja test) of:

------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: /share/gnuradio/gr40/src/pmt
------------------------------------------------------------------------------
File                                       Lines    Exec  Cover   Missing
------------------------------------------------------------------------------
bench/bm_pmt_dict_pack_unpack.cpp             23       0     0%   15,18-19,21,24-26,28,30,54,57,59-60,63,66-67,69,73,75,77,79,81-82
bench/bm_pmt_dict_ref.cpp                     29       0     0%   15,17,19,21-22,24,28-29,31,34,37,39-41,44,47-49,51,55-56,61,64,66,68,70,72,74-75
bench/bm_pmt_serialize_uvec.cpp               27       0     0%   13,15,17-18,20,22-26,29,32,34-35,37,40-41,43,47-48,50,52,54,56,58,60-61
build/include/pmtf/pmtf_generated.h          675     654    96%   522-523,528-529,559-560,565-566,1303-1304,1306-1308,1310-1313,1317,1320-1322
include/pmtf/base.hpp                         89      81    91%   147,153,162-163,166-167,234,247
include/pmtf/gsl-lite.hpp                     43      41    95%   1935,1937
include/pmtf/map.hpp                          43      42    97%   145
include/pmtf/scalar.hpp                       79      74    93%   122,146-147,197,225
include/pmtf/string.hpp                       62      57    91%   127,147-149,156
include/pmtf/vector.hpp                      145     138    95%   257-258,288,330,334-336
include/pmtf/wrap.hpp                        143      88    61%   33,35-37,39-43,45-50,52-60,76-77,101,125-127,129-137,139-144,146-151,153-154,188,232
lib/base.cpp                                   4       2    50%   20,22
lib/vector.cpp                                 4       2    50%   15-16
lib/wrap.cpp                                   4       3    75%   16
python/pmtf/bindings/pmtf_python.cc            7       0     0%   25,27-28,31,35,37-38
python/pmtf/bindings/string_python.cc          3       0     0%   22,26,28
python/pmtf/bindings/wrap_python.cc          117       0     0%   25,28,31,34-47,54-76,81-82,84-85,87-89,94-102,106-129,133-141,145-170,173-174
test/qa_map.cpp                               41      41   100%   
test/qa_pmt.cpp                               22      22   100%   
test/qa_scalar.cpp                            67      63    94%   60,62,65,67
test/qa_string.cpp                            22      22   100%   
test/qa_vector.cpp                           104     100    96%   59,61,64,66
test/qa_vector_pmt.cpp                        45      45   100%   
test/test_pmtf.cpp                             1       0     0%   19
------------------------------------------------------------------------------
TOTAL                                       1799    1475    82%
------------------------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants