Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux.fr machine (x86_64 architecture), and agregate them in the final report:

The target is to exceed 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - kernel/gmp - mp.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30370-b9c4b6d044) Lines: 683 719 95.0 %
Date: 2025-07-05 09:22:59 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115394503
absdiviu_rem 110782423
addiispec 3333941091
adduispec 2787699261
adduispec_offset 767327888
addumului 0
affir 403819120
cmpiispec 3971262188
convi 438670
diviiexact 533364173
divis 1006043
divis_rem 86168470
diviuexact 39413678
diviuexact_i 420693772
diviuuexact 200430
divri 151400622
divri_with_gmp 35251285
divrr 142765581
divrr_with_gmp 76135902
dvmdii 2195778045
equaliispec 269586953
floorr 7128714
icopy_ef 41257969
incloop 103178843
incneg 66684
incpos 102775756
int_normalize 308627188
mantissa2nr 138189513
mpz2GEN 57698486
muliispec 5953219280
muliispec_mirror 85091403
muluispec 5616339813
muluui 222683
pari_gmp_free 1755939
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35036709
remi2n 38981900
resetloop 174328
roundr_up_ip 527611430
setloop 2997876
shiftispec 714339904
sqrispec 1025341973
sqrispec_mirror 41396701
sqrtr_abs 126376658
sqrtremi 5182331
subiispec 3018172873
subiuspec 1777227713
truncr 3629385
umodiu 1314183757
xmpn_copy 6890198
xmpn_mirror 587289281
xmpn_mirrorcopy 718624064
xmpn_zero 237518491

Generated by: LCOV version 1.16