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

Generated by: LCOV version 1.16