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

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117019372
absdiviu_rem 52884418
addiispec 3498209589
adduispec 2910539126
adduispec_offset 775143578
addumului 0
affir 422162366
cmpiispec 4257580630
convi 447817
diviiexact 561421468
divis 336639
divis_rem 94406523
diviuexact 34277745
diviuexact_i 441881770
diviuuexact 200898
divri 161200187
divri_with_gmp 35425289
divrr 151751016
divrr_with_gmp 78686554
dvmdii 2315762923
equaliispec 310393082
floorr 6430010
icopy_ef 42969788
incloop 64309593
incneg 66684
incpos 63906257
int_normalize 322837378
mantissa2nr 142732150
mpz2GEN 58509686
muliispec 6213300014
muliispec_mirror 86836573
muluispec 5943394207
muluui 223122
pari_gmp_free 1632821
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34730284
remi2n 38558972
resetloop 174380
roundr_up_ip 562370613
setloop 2999288
shiftispec 763987457
sqrispec 1083321065
sqrispec_mirror 42195509
sqrtr_abs 131573940
sqrtremi 5137797
subiispec 3278143778
subiuspec 1873915387
truncr 2530524
umodiu 1373973518
xmpn_copy 7066592
xmpn_mirror 609302753
xmpn_mirrorcopy 742277638
xmpn_zero 245685783

Generated by: LCOV version 2.0-1