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 30617-dd5c93fb0e) Lines: 683 719 95.0 %
Date: 2026-01-21 09:23:33 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1104
pari_kernel_init 1112
incneg 66684
resetloop 174328
diviuuexact 200480
muluui 222698
divis 323939
convi 439582
pari_gmp_free 1762881
setloop 2999295
truncr 3436527
sqrtremi 5128719
xmpn_copy 6836373
floorr 6940954
diviuexact 31782515
red_montgomery 34438280
divri_with_gmp 35477456
remi2n 38015058
sqrispec_mirror 40087141
icopy_ef 41516210
absdiviu_rem 51271448
mpz2GEN 57769818
divrr_with_gmp 76229104
muliispec_mirror 83331639
divis_rem 86343591
incpos 103537135
incloop 103944625
GEN2mpz 115536810
sqrtr_abs 126374410
mantissa2nr 138638664
divrr 142520609
divri 151784493
xmpn_zero 237805298
equaliispec 267830118
int_normalize 308908946
affir 405044980
diviuexact_i 413381263
roundr_up_ip 518738849
diviiexact 534260948
xmpn_mirror 585346082
shiftispec 713816726
xmpn_mirrorcopy 714768597
adduispec_offset 764288565
sqrispec 1024909019
umodiu 1329043648
subiuspec 1778228690
dvmdii 2192554895
adduispec 2786683348
subiispec 3017892138
addiispec 3332878367
cmpiispec 3974795854
muluispec 5603834699
muliispec 5835387241

Generated by: LCOV version 1.16