gnuradio / pmt

pmt
GNU Lesser General Public License v3.0
11 stars 11 forks source link

Improve Unit Testing #25

Open jsallay opened 2 years ago

jsallay commented 2 years ago

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

As part of this we should:

mormj commented 2 years ago

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%
------------------------------------------------------------------------------