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 30673-b6380924e9) Lines: 683 719 95.0 %
Date: 2026-02-08 09:23:25 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 200526
muluui 222733
divis 323958
convi 439949
pari_gmp_free 1763114
setloop 2999294
truncr 3465199
sqrtremi 5128958
xmpn_copy 6836623
floorr 6949104
diviuexact 31787918
red_montgomery 34402565
divri_with_gmp 35479281
remi2n 38103611
sqrispec_mirror 40108202
icopy_ef 41533944
absdiviu_rem 51280524
mpz2GEN 57781781
divrr_with_gmp 76257946
muliispec_mirror 83383893
divis_rem 86379480
incpos 102911533
incloop 103316515
GEN2mpz 115561456
sqrtr_abs 126387233
mantissa2nr 138683432
divrr 142572582
divri 151798478
xmpn_zero 237939927
equaliispec 267756929
int_normalize 308817860
affir 405480815
diviuexact_i 413705242
roundr_up_ip 519448966
diviiexact 534590958
xmpn_mirror 586183082
shiftispec 714564693
xmpn_mirrorcopy 715395546
adduispec_offset 765721452
sqrispec 1024725041
umodiu 1332667183
subiuspec 1777116880
dvmdii 2194783919
adduispec 2791641694
subiispec 3014632834
addiispec 3333019998
cmpiispec 3972152979
muluispec 5606240833
muliispec 5834806140

Generated by: LCOV version 1.16