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-05 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
GEN2mpz 115612563
absdiviu_rem 51098092
addiispec 3337710847
adduispec 2789502203
adduispec_offset 764639322
addumului 0
affir 404416938
cmpiispec 3982859052
convi 439762
diviiexact 534568435
divis 325454
divis_rem 86358723
diviuexact 31836380
diviuexact_i 413684305
diviuuexact 200461
divri 151545496
divri_with_gmp 35251722
divrr 142555194
divrr_with_gmp 76255521
dvmdii 2197478265
equaliispec 268869598
floorr 6946926
icopy_ef 41504360
incloop 103799161
incneg 66684
incpos 103398728
int_normalize 307009433
mantissa2nr 138424657
mpz2GEN 57807709
muliispec 5843563634
muliispec_mirror 83343523
muluispec 5604054407
muluui 222687
pari_gmp_free 1755990
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34932068
remi2n 39152877
resetloop 174328
roundr_up_ip 518696920
setloop 2999294
shiftispec 720301126
sqrispec 1030323041
sqrispec_mirror 40089739
sqrtr_abs 126400981
sqrtremi 5162788
subiispec 3024684043
subiuspec 1780263772
truncr 3457764
umodiu 1328088143
xmpn_copy 6897614
xmpn_mirror 584740282
xmpn_mirrorcopy 714114699
xmpn_zero 237628808

Generated by: LCOV version 1.16