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 30582-6e9af8ee1d) Lines: 683 719 95.0 %
Date: 2025-12-20 09:23:49 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115608798
absdiviu_rem 51105345
addiispec 3340401924
adduispec 2790680610
adduispec_offset 764634121
addumului 0
affir 404540421
cmpiispec 3985369553
convi 439733
diviiexact 535341664
divis 325552
divis_rem 86389732
diviuexact 31850951
diviuexact_i 414491269
diviuuexact 200491
divri 151548991
divri_with_gmp 35252734
divrr 142573497
divrr_with_gmp 76261326
dvmdii 2199484142
equaliispec 268888971
floorr 6948328
icopy_ef 41505380
incloop 103504847
incneg 66684
incpos 103106906
int_normalize 308533375
mantissa2nr 138434983
mpz2GEN 57805780
muliispec 5847517491
muliispec_mirror 83264021
muluispec 5608016216
muluui 222727
pari_gmp_free 1752302
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35395434
remi2n 39166797
resetloop 174328
roundr_up_ip 518739421
setloop 2999295
shiftispec 720940456
sqrispec 1031299572
sqrispec_mirror 40095374
sqrtr_abs 126400524
sqrtremi 5162723
subiispec 3026912880
subiuspec 1781212768
truncr 3461935
umodiu 1330841248
xmpn_copy 6935082
xmpn_mirror 584895324
xmpn_mirrorcopy 714247488
xmpn_zero 237649519

Generated by: LCOV version 1.16