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
GEN2mpz 115622108
absdiviu_rem 51098953
addiispec 3338915103
adduispec 2790540675
adduispec_offset 765010071
addumului 0
affir 404651330
cmpiispec 3984883649
convi 439778
diviiexact 534796782
divis 325454
divis_rem 86388101
diviuexact 31839390
diviuexact_i 413900920
diviuuexact 200516
divri 151548477
divri_with_gmp 35252111
divrr 142563024
divrr_with_gmp 76260983
dvmdii 2198953685
equaliispec 268868944
floorr 6950106
icopy_ef 41507039
incloop 103637634
incneg 66684
incpos 103238446
int_normalize 307296750
mantissa2nr 138430905
mpz2GEN 57812073
muliispec 5847092474
muliispec_mirror 83399599
muluispec 5607782949
muluui 222737
pari_gmp_free 1756000
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34868192
remi2n 39217410
resetloop 174328
roundr_up_ip 518859123
setloop 2999294
shiftispec 720583588
sqrispec 1031013134
sqrispec_mirror 40103779
sqrtr_abs 126397954
sqrtremi 5162769
subiispec 3026197053
subiuspec 1780850124
truncr 3463293
umodiu 1328388053
xmpn_copy 6897365
xmpn_mirror 585066532
xmpn_mirrorcopy 714469169
xmpn_zero 237656732

Generated by: LCOV version 1.16