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 30572-91e0396466) Lines: 683 719 95.0 %
Date: 2025-12-13 09:22:30 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 200503
muluui 222730
divis 325454
convi 439756
pari_gmp_free 1755985
setloop 2999293
truncr 3461076
sqrtremi 5162740
xmpn_copy 6897522
floorr 6947808
diviuexact 31838022
red_montgomery 35002237
divri_with_gmp 35251351
remi2n 39194100
sqrispec_mirror 40092665
icopy_ef 41506965
absdiviu_rem 51104085
mpz2GEN 57808781
divrr_with_gmp 76257540
muliispec_mirror 83341505
divis_rem 86364260
incpos 103177910
incloop 103577808
GEN2mpz 115615193
sqrtr_abs 126393650
mantissa2nr 138420461
divrr 142555110
divri 151545579
xmpn_zero 237631347
equaliispec 268869629
int_normalize 307190617
affir 404492486
diviuexact_i 413791890
roundr_up_ip 518733872
diviiexact 534667559
xmpn_mirror 584808945
xmpn_mirrorcopy 714190322
shiftispec 720296218
adduispec_offset 764472642
sqrispec 1030396837
umodiu 1331227741
subiuspec 1780422784
dvmdii 2197886311
adduispec 2792491169
subiispec 3024732310
addiispec 3338121415
cmpiispec 3982993300
muluispec 5606715079
muliispec 5845625331

Generated by: LCOV version 1.16