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 30550-07450a7a86) Lines: 683 719 95.0 %
Date: 2025-11-18 09:22:37 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 200467
muluui 222718
divis 325429
convi 439617
pari_gmp_free 1755946
setloop 2999293
truncr 3456573
sqrtremi 5162181
xmpn_copy 6897009
floorr 6945519
diviuexact 31838382
red_montgomery 35047988
divri_with_gmp 35251183
remi2n 39047314
sqrispec_mirror 40038483
icopy_ef 41490472
absdiviu_rem 51005736
mpz2GEN 57762398
divrr_with_gmp 76236909
muliispec_mirror 83251750
divis_rem 86254669
incpos 103211763
incloop 103621846
GEN2mpz 115522182
sqrtr_abs 126365373
mantissa2nr 138305780
divrr 142524618
divri 151467433
xmpn_zero 237565888
equaliispec 268857620
int_normalize 307099808
affir 404196297
diviuexact_i 413196076
roundr_up_ip 518395536
diviiexact 533885653
xmpn_mirror 584381305
xmpn_mirrorcopy 713816188
shiftispec 720126977
adduispec_offset 764471667
sqrispec 1030572657
umodiu 1329124705
subiuspec 1779045286
dvmdii 2197093263
adduispec 2788210929
subiispec 3023317221
addiispec 3336452381
cmpiispec 3979572745
muluispec 5599076446
muliispec 5839437397

Generated by: LCOV version 1.16