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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 95.0 % 718 682
Test Date: 2026-08-08 17:03:11 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117030088
absdiviu_rem 52880490
addiispec 3498377109
adduispec 2911165464
adduispec_offset 775349273
addumului 0
affir 422218816
cmpiispec 4257803431
convi 447825
diviiexact 561494973
divis 336637
divis_rem 94421341
diviuexact 34279654
diviuexact_i 441948391
diviuuexact 200898
divri 161202222
divri_with_gmp 35425496
divrr 151752634
divrr_with_gmp 78685964
dvmdii 2316031048
equaliispec 310395143
floorr 6429926
icopy_ef 42977494
incloop 64242891
incneg 66684
incpos 63839554
int_normalize 322925494
mantissa2nr 142738333
mpz2GEN 58515044
muliispec 6213680077
muliispec_mirror 86836573
muluispec 5943827497
muluui 223122
pari_gmp_free 1632829
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34728771
remi2n 38669466
resetloop 174380
roundr_up_ip 562389793
setloop 2999288
shiftispec 764095457
sqrispec 1083303299
sqrispec_mirror 42195542
sqrtr_abs 131574223
sqrtremi 5137860
subiispec 3278372940
subiuspec 1874156305
truncr 2530440
umodiu 1374466794
xmpn_copy 7066559
xmpn_mirror 609345490
xmpn_mirrorcopy 742283959
xmpn_zero 245685683

Generated by: LCOV version 2.0-1