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-12 09:21:57 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 200461
muluui 222694
divis 323933
convi 439773
pari_gmp_free 1762888
setloop 2999291
truncr 3452398
sqrtremi 5128745
xmpn_copy 6836250
floorr 6943015
diviuexact 31783150
red_montgomery 34341193
divri_with_gmp 35477155
remi2n 37990208
sqrispec_mirror 40092383
icopy_ef 41521653
absdiviu_rem 51274119
mpz2GEN 57768684
divrr_with_gmp 76240620
muliispec_mirror 83221453
divis_rem 86374153
incpos 103440283
incloop 103850892
GEN2mpz 115534913
sqrtr_abs 126364340
mantissa2nr 138645263
divrr 142518731
divri 151789241
xmpn_zero 237887729
equaliispec 267835847
int_normalize 308500242
affir 405038919
diviuexact_i 413505670
roundr_up_ip 518920464
diviiexact 534398397
xmpn_mirror 585437860
shiftispec 713917578
xmpn_mirrorcopy 714973776
adduispec_offset 764928917
sqrispec 1023925050
umodiu 1328167295
subiuspec 1778465853
dvmdii 2192061457
adduispec 2786579603
subiispec 3016750518
addiispec 3332248251
cmpiispec 3974492766
muluispec 5605010953
muliispec 5837245009

Generated by: LCOV version 1.16