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 30724-b49b12e983) Lines: 683 719 95.0 %
Date: 2026-03-02 09:24:58 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 1084
pari_kernel_init 1092
incneg 66684
resetloop 174328
diviuuexact 200535
muluui 222747
divis 323960
convi 440322
pari_gmp_free 1762607
setloop 2999282
truncr 3454380
sqrtremi 5128858
xmpn_copy 6854030
floorr 6945488
diviuexact 34099981
red_montgomery 34461745
divri_with_gmp 35479274
remi2n 38055801
sqrispec_mirror 40124004
icopy_ef 41520666
absdiviu_rem 51277055
mpz2GEN 57777524
divrr_with_gmp 76247965
muliispec_mirror 83327519
incpos 87109308
incloop 87514325
divis_rem 94062289
GEN2mpz 115553248
sqrtr_abs 126389515
mantissa2nr 138690420
divrr 142548221
divri 151793860
xmpn_zero 237965028
equaliispec 266937842
int_normalize 309359674
affir 405497587
diviuexact_i 431097990
roundr_up_ip 528754705
diviiexact 550373708
xmpn_mirror 586197317
xmpn_mirrorcopy 715618488
shiftispec 737973355
adduispec_offset 765174648
sqrispec 1098061578
umodiu 1345410437
subiuspec 1815280366
dvmdii 2212805200
adduispec 2832643071
subiispec 3057757980
addiispec 3375569928
cmpiispec 4012422844
muluispec 5696235901
muliispec 5927101067

Generated by: LCOV version 1.16