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 30590-f14e077362) Lines: 684 719 95.1 %
Date: 2025-12-31 09:21:49 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115603721
absdiviu_rem 51094670
addiispec 3335795714
adduispec 2790340964
adduispec_offset 765259103
addumului 0
affir 404543942
cmpiispec 3978002892
convi 439777
diviiexact 534265693
divis 323942
divis_rem 86365643
diviuexact 31787426
diviuexact_i 413352786
diviuuexact 200534
divri 151542979
divri_with_gmp 35252062
divrr 142564595
divrr_with_gmp 76256288
dvmdii 2194914300
equaliispec 268815797
floorr 6946845
icopy_ef 41492150
incloop 103720356
incneg 66684
incpos 103311688
int_normalize 309217698
mantissa2nr 138436090
mpz2GEN 57803111
muliispec 5843210941
muliispec_mirror 83327761
muluispec 5610850527
muluui 222771
pari_gmp_free 1735793
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34422152
remi2n 37757766
resetloop 174328
roundr_up_ip 518831036
setloop 2999292
shiftispec 714092886
sqrispec 1025477977
sqrispec_mirror 40097430
sqrtr_abs 126399809
sqrtremi 5159859
subiispec 3020730472
subiuspec 1780730120
truncr 3458059
umodiu 1329841376
xmpn_copy 6832592
xmpn_mirror 585094818
xmpn_mirrorcopy 714566887
xmpn_zero 237691320

Generated by: LCOV version 1.16