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-10-11 17:02:16 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1092
pari_kernel_init 1100
incneg 66684
resetloop 174380
diviuuexact 200898
muluui 223122
divis 336639
convi 447830
pari_gmp_free 1632816
truncr 2530495
setloop 2999288
sqrtremi 5137754
floorr 6429897
xmpn_copy 7067294
diviuexact 34277835
red_montgomery 34742924
divri_with_gmp 35425541
remi2n 38602804
sqrispec_mirror 42195509
icopy_ef 42964524
absdiviu_rem 52881880
mpz2GEN 58506090
incpos 63955806
incloop 64359142
divrr_with_gmp 78682761
muliispec_mirror 86836573
divis_rem 94370737
GEN2mpz 117012180
sqrtr_abs 131568219
mantissa2nr 142719452
divrr 151744385
divri 161195506
xmpn_zero 245676521
equaliispec 310386286
int_normalize 322876025
affir 422114284
diviuexact_i 441847437
diviiexact 561382608
roundr_up_ip 562331365
xmpn_mirror 609231280
xmpn_mirrorcopy 742248906
shiftispec 763828669
adduispec_offset 775235583
sqrispec 1082843258
umodiu 1373399143
subiuspec 1873678492
dvmdii 2314875452
adduispec 2909722475
subiispec 3277019635
addiispec 3497587572
cmpiispec 4256006351
muluispec 5942454926
muliispec 6212404557

Generated by: LCOV version 2.0-1