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 30506-a80f2baa63) Lines: 688 719 95.7 %
Date: 2025-09-30 09:23:41 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115526406
absdiviu_rem 50864503
addiispec 3337836222
adduispec 2790050828
adduispec_offset 764943808
addumului 0
affir 404277175
cmpiispec 3981241191
convi 439443
diviiexact 534055301
divis 325430
divis_rem 86250731
diviuexact 31843821
diviuexact_i 413355857
diviuuexact 200468
divri 151455764
divri_with_gmp 35250593
divrr 142877391
divrr_with_gmp 76407377
dvmdii 2197945487
equaliispec 268849520
floorr 7141226
icopy_ef 41492456
incloop 103537717
incneg 66684
incpos 103135904
int_normalize 306044465
mantissa2nr 138495605
mpz2GEN 57764538
muliispec 5846213181
muliispec_mirror 85298256
muluispec 5604975548
muluui 222690
pari_gmp_free 1755955
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35016168
remi2n 39047146
resetloop 174328
roundr_up_ip 527460413
setloop 2999288
shiftispec 720661937
sqrispec 1032249710
sqrispec_mirror 41496151
sqrtr_abs 126704975
sqrtremi 5162050
subiispec 3023830527
subiuspec 1779095000
truncr 3652675
umodiu 1329192885
xmpn_copy 6897136
xmpn_mirror 588163115
xmpn_mirrorcopy 720373265
xmpn_zero 238109515

Generated by: LCOV version 1.16