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 30670-52869c8c38) Lines: 683 719 95.0 %
Date: 2026-02-05 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
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1104
pari_kernel_init 1112
incneg 66684
resetloop 174328
diviuuexact 200531
muluui 222763
divis 323957
convi 439919
pari_gmp_free 1763124
setloop 2999289
truncr 3460551
sqrtremi 5128863
xmpn_copy 6836492
floorr 6946721
diviuexact 31788755
red_montgomery 34421252
divri_with_gmp 35478979
remi2n 38045449
sqrispec_mirror 40108567
icopy_ef 41530162
absdiviu_rem 51266290
mpz2GEN 57783589
divrr_with_gmp 76253239
muliispec_mirror 83361310
divis_rem 86384302
incpos 103475668
incloop 103885903
GEN2mpz 115564918
sqrtr_abs 126383417
mantissa2nr 138673503
divrr 142563631
divri 151794896
xmpn_zero 237933441
equaliispec 267855032
int_normalize 308798559
affir 405466347
diviuexact_i 413630986
roundr_up_ip 519471435
diviiexact 534535105
xmpn_mirror 586355677
shiftispec 714590447
xmpn_mirrorcopy 715526757
adduispec_offset 765939955
sqrispec 1025350555
umodiu 1329686183
subiuspec 1777042692
dvmdii 2196436522
adduispec 2788878048
subiispec 3015359657
addiispec 3333417458
cmpiispec 3973941053
muluispec 5606210695
muliispec 5834670674

Generated by: LCOV version 1.16