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

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117014238
absdiviu_rem 52884359
addiispec 3497710936
adduispec 2909348600
adduispec_offset 775272080
addumului 0
affir 422133419
cmpiispec 4255877683
convi 447820
diviiexact 561401833
divis 336637
divis_rem 94377252
diviuexact 34277240
diviuexact_i 441864379
diviuuexact 200898
divri 161200749
divri_with_gmp 35425766
divrr 151748952
divrr_with_gmp 78685216
dvmdii 2314644511
equaliispec 310390796
floorr 6429975
icopy_ef 42970110
incloop 64315828
incneg 66684
incpos 63912492
int_normalize 322893322
mantissa2nr 142732271
mpz2GEN 58507119
muliispec 6212840493
muliispec_mirror 86836573
muluispec 5942929943
muluui 223122
pari_gmp_free 1632819
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34730577
remi2n 38621541
resetloop 174380
roundr_up_ip 562358550
setloop 2999288
shiftispec 763799280
sqrispec 1082669983
sqrispec_mirror 42195509
sqrtr_abs 131573713
sqrtremi 5137692
subiispec 3277019006
subiuspec 1873863017
truncr 2530488
umodiu 1372883052
xmpn_copy 7066359
xmpn_mirror 609284388
xmpn_mirrorcopy 742271510
xmpn_zero 245684695

Generated by: LCOV version 2.0-1