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-12-03 17:02:49 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 336637
convi 447818
pari_gmp_free 1632826
truncr 2530472
setloop 2999288
sqrtremi 5137767
floorr 6429947
xmpn_copy 7066463
diviuexact 34277115
red_montgomery 34727338
divri_with_gmp 35425003
remi2n 38686245
sqrispec_mirror 42195542
icopy_ef 42972932
absdiviu_rem 52876292
mpz2GEN 58510562
incpos 63878822
incloop 64282158
divrr_with_gmp 78685161
muliispec_mirror 86836573
divis_rem 94387361
GEN2mpz 117021124
sqrtr_abs 131569457
mantissa2nr 142728352
divrr 151747668
divri 161200461
xmpn_zero 245679621
equaliispec 310394137
int_normalize 322896759
affir 422174592
diviuexact_i 441875890
diviiexact 561419125
roundr_up_ip 562377108
xmpn_mirror 609305711
xmpn_mirrorcopy 742267799
shiftispec 763740107
adduispec_offset 775378242
sqrispec 1082305879
umodiu 1373081484
subiuspec 1874034435
dvmdii 2314206123
adduispec 2909663313
subiispec 3276624990
addiispec 3497622348
cmpiispec 4255219411
muluispec 5943055542
muliispec 6212885784

Generated by: LCOV version 2.0-1