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 30571-c0dfe82732) Lines: 683 719 95.0 %
Date: 2025-12-09 09:22:05 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115613099
absdiviu_rem 51103610
addiispec 3338057230
adduispec 2791688619
adduispec_offset 764532039
addumului 0
affir 404473407
cmpiispec 3983054713
convi 439753
diviiexact 534685327
divis 325441
divis_rem 86384299
diviuexact 31839386
diviuexact_i 413814344
diviuuexact 200481
divri 151545704
divri_with_gmp 35251425
divrr 142549252
divrr_with_gmp 76256774
dvmdii 2197889737
equaliispec 268870114
floorr 6947172
icopy_ef 41506262
incloop 103775733
incneg 66684
incpos 103374728
int_normalize 307115336
mantissa2nr 138417103
mpz2GEN 57807902
muliispec 5845357056
muliispec_mirror 83372362
muluispec 5606224488
muluui 222720
pari_gmp_free 1755990
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34945901
remi2n 39165603
resetloop 174328
roundr_up_ip 518789420
setloop 2999290
shiftispec 720337674
sqrispec 1030282132
sqrispec_mirror 40084303
sqrtr_abs 126393976
sqrtremi 5162736
subiispec 3024737357
subiuspec 1780415351
truncr 3461159
umodiu 1330235492
xmpn_copy 6897467
xmpn_mirror 584780231
xmpn_mirrorcopy 714129478
xmpn_zero 237626208

Generated by: LCOV version 1.16