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-17 17:03:22 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 447817
pari_gmp_free 1632825
truncr 2530489
setloop 2999288
sqrtremi 5137826
floorr 6430011
xmpn_copy 7066480
diviuexact 34276494
red_montgomery 34738545
divri_with_gmp 35425380
remi2n 38703502
sqrispec_mirror 42195542
icopy_ef 42968560
absdiviu_rem 52878755
mpz2GEN 58514500
incpos 63861500
incloop 64264836
divrr_with_gmp 78685869
muliispec_mirror 86836573
divis_rem 94360790
GEN2mpz 117029000
sqrtr_abs 131573650
mantissa2nr 142724955
divrr 151749812
divri 161195846
xmpn_zero 245684899
equaliispec 310389212
int_normalize 322954156
affir 422149646
diviuexact_i 441846916
diviiexact 561394992
roundr_up_ip 562349990
xmpn_mirror 609255655
xmpn_mirrorcopy 742269010
shiftispec 764080325
adduispec_offset 775418133
sqrispec 1083392367
umodiu 1373038525
subiuspec 1873863463
dvmdii 2316237727
adduispec 2909418944
subiispec 3278158697
addiispec 3498066291
cmpiispec 4257554189
muluispec 5942974800
muliispec 6212878460

Generated by: LCOV version 2.0-1