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 30401-87099e65a6) Lines: 683 719 95.0 %
Date: 2025-07-17 09:22:54 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 200480
muluui 222706
convi 439105
divis 1006061
pari_gmp_free 1755948
setloop 2999283
truncr 3648939
sqrtremi 5182386
xmpn_copy 6889746
floorr 7133943
red_montgomery 35023144
divri_with_gmp 35250262
remi2n 39003994
diviuexact 39581333
icopy_ef 41272110
sqrispec_mirror 41391862
mpz2GEN 57689795
divrr_with_gmp 76151506
muliispec_mirror 85065844
divis_rem 86201076
incpos 103037683
incloop 103446530
absdiviu_rem 110604171
GEN2mpz 115376991
sqrtr_abs 126369843
mantissa2nr 138184370
divrr 142788373
divri 151402833
xmpn_zero 237527581
equaliispec 269624395
int_normalize 306613361
affir 403800713
diviuexact_i 418953729
roundr_up_ip 527645482
diviiexact 531421062
xmpn_mirror 587302129
shiftispec 714958113
xmpn_mirrorcopy 718597115
adduispec_offset 764550187
sqrispec 1028734878
umodiu 1324976357
subiuspec 1774043067
dvmdii 2194880302
adduispec 2782760289
subiispec 3017018168
addiispec 3331407671
cmpiispec 3973483749
muluispec 5603442960
muliispec 5938705301

Generated by: LCOV version 1.16