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

Generated by: LCOV version 1.16