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

Generated by: LCOV version 1.16