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 30718-589d22da69) Lines: 683 719 95.0 %
Date: 2026-02-27 09:23:18 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 200542
muluui 222772
divis 323963
convi 440316
pari_gmp_free 1762578
setloop 2999284
truncr 3462864
sqrtremi 5128969
xmpn_copy 6853824
floorr 6948224
diviuexact 34097300
red_montgomery 34306650
divri_with_gmp 35477739
remi2n 38064810
sqrispec_mirror 40123853
icopy_ef 41524974
absdiviu_rem 51273881
mpz2GEN 57776871
divrr_with_gmp 76253066
muliispec_mirror 83308294
incpos 87035529
incloop 87436935
divis_rem 94075164
GEN2mpz 115551713
sqrtr_abs 126386782
mantissa2nr 138682416
divrr 142556664
divri 151795069
xmpn_zero 237945155
equaliispec 268371361
int_normalize 309145123
affir 405551799
diviuexact_i 431470104
roundr_up_ip 528704307
diviiexact 550733138
xmpn_mirror 586179894
xmpn_mirrorcopy 715536777
shiftispec 737840795
adduispec_offset 765359459
sqrispec 1057841065
umodiu 1349806470
subiuspec 1815595326
dvmdii 2212460167
adduispec 2833986013
subiispec 3057841980
addiispec 3374853837
cmpiispec 4010134302
muluispec 5685593623
muliispec 5916428781

Generated by: LCOV version 1.16