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 30569-8181146aa1) Lines: 688 719 95.7 %
Date: 2025-12-02 09:22:09 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 200470
muluui 222686
divis 325454
convi 439745
pari_gmp_free 1755998
setloop 2999293
truncr 3463116
sqrtremi 5162815
xmpn_copy 6897480
floorr 6948646
diviuexact 31840086
red_montgomery 34867439
divri_with_gmp 35251601
remi2n 39135834
sqrispec_mirror 40088540
icopy_ef 41505350
absdiviu_rem 51102557
mpz2GEN 57806356
divrr_with_gmp 76257762
muliispec_mirror 83386088
divis_rem 86377898
incpos 103092532
incloop 103492244
GEN2mpz 115610188
sqrtr_abs 126393120
mantissa2nr 138419442
divrr 142555032
divri 151546214
xmpn_zero 237623722
equaliispec 268869938
int_normalize 307209082
affir 404517441
diviuexact_i 413853696
roundr_up_ip 518763239
diviiexact 534718412
xmpn_mirror 584852288
xmpn_mirrorcopy 714195955
shiftispec 720324971
adduispec_offset 764618474
sqrispec 1030192036
umodiu 1329191597
subiuspec 1780448989
dvmdii 2197505349
adduispec 2790930063
subiispec 3024501257
addiispec 3337923568
cmpiispec 3982740815
muluispec 5604901562
muliispec 5844405446

Generated by: LCOV version 1.16