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 30574-595e4ba651) Lines: 683 719 95.0 %
Date: 2025-12-17 09:21:45 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 200516
muluui 222737
divis 325454
convi 439778
pari_gmp_free 1756000
setloop 2999294
truncr 3463293
sqrtremi 5162769
xmpn_copy 6897365
floorr 6950106
diviuexact 31839390
red_montgomery 34868192
divri_with_gmp 35252111
remi2n 39217410
sqrispec_mirror 40103779
icopy_ef 41507039
absdiviu_rem 51098953
mpz2GEN 57812073
divrr_with_gmp 76260983
muliispec_mirror 83399599
divis_rem 86388101
incpos 103238446
incloop 103637634
GEN2mpz 115622108
sqrtr_abs 126397954
mantissa2nr 138430905
divrr 142563024
divri 151548477
xmpn_zero 237656732
equaliispec 268868944
int_normalize 307296750
affir 404651330
diviuexact_i 413900920
roundr_up_ip 518859123
diviiexact 534796782
xmpn_mirror 585066532
xmpn_mirrorcopy 714469169
shiftispec 720583588
adduispec_offset 765010071
sqrispec 1031013134
umodiu 1328388053
subiuspec 1780850124
dvmdii 2198953685
adduispec 2790540675
subiispec 3026197053
addiispec 3338915103
cmpiispec 3984883649
muluispec 5607782949
muliispec 5847092474

Generated by: LCOV version 1.16