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 30480-572da319a6) Lines: 683 719 95.0 %
Date: 2025-08-27 09:24:05 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115522784
absdiviu_rem 50867443
addiispec 3336344614
adduispec 2786103278
adduispec_offset 764634618
addumului 0
affir 404097617
cmpiispec 3979615343
convi 439357
diviiexact 533782516
divis 325462
divis_rem 86199526
diviuexact 31840224
diviuexact_i 413072294
diviuuexact 200478
divri 151450901
divri_with_gmp 35251644
divrr 142786659
divrr_with_gmp 76329458
dvmdii 2195623692
equaliispec 269626415
floorr 7128700
icopy_ef 41474582
incloop 103917223
incneg 66684
incpos 103515608
int_normalize 306693501
mantissa2nr 138404939
mpz2GEN 57762822
muliispec 5842165262
muliispec_mirror 85127599
muluispec 5600739724
muluui 222713
pari_gmp_free 1755951
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34988130
remi2n 39074350
resetloop 174328
roundr_up_ip 527465158
setloop 2999279
shiftispec 719980601
sqrispec 1031420390
sqrispec_mirror 41404060
sqrtr_abs 126563025
sqrtremi 5160730
subiispec 3022531229
subiuspec 1778673835
truncr 3627108
umodiu 1326710711
xmpn_copy 6896333
xmpn_mirror 587813697
xmpn_mirrorcopy 719615116
xmpn_zero 237904362

Generated by: LCOV version 1.16