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 30605-980f9eb85c) Lines: 683 719 95.0 %
Date: 2026-01-11 09:21:30 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115544506
absdiviu_rem 51269283
addiispec 3332445448
adduispec 2785563499
adduispec_offset 764863184
addumului 0
affir 405016161
cmpiispec 3974573896
convi 439791
diviiexact 534465964
divis 323941
divis_rem 86380525
diviuexact 31783853
diviuexact_i 413585008
diviuuexact 200480
divri 151789730
divri_with_gmp 35477501
divrr 142522204
divrr_with_gmp 76240073
dvmdii 2192046108
equaliispec 267836025
floorr 6943159
icopy_ef 41523491
incloop 103816896
incneg 66684
incpos 103408538
int_normalize 308418648
mantissa2nr 138649776
mpz2GEN 57773723
muliispec 5836526644
muliispec_mirror 83174164
muluispec 5604997111
muluui 222695
pari_gmp_free 1762891
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34309216
remi2n 38044360
resetloop 174328
roundr_up_ip 518903803
setloop 2999294
shiftispec 714010075
sqrispec 1023713268
sqrispec_mirror 40094141
sqrtr_abs 126370161
sqrtremi 5128741
subiispec 3017103011
subiuspec 1778799733
truncr 3453092
umodiu 1326849069
xmpn_copy 6836443
xmpn_mirror 585370733
xmpn_mirrorcopy 714842456
xmpn_zero 237886649

Generated by: LCOV version 1.16