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 30532-0c728fd268) Lines: 683 719 95.0 %
Date: 2025-10-19 09:22:25 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115535100
absdiviu_rem 50865967
addiispec 3336526733
adduispec 2790010943
adduispec_offset 764382187
addumului 0
affir 404195872
cmpiispec 3979410962
convi 439470
diviiexact 533877809
divis 325427
divis_rem 86233887
diviuexact 31840108
diviuexact_i 413165686
diviuuexact 200535
divri 151453373
divri_with_gmp 35249290
divrr 142884492
divrr_with_gmp 76409540
dvmdii 2196413786
equaliispec 268850390
floorr 7143722
icopy_ef 41494811
incloop 103470383
incneg 66684
incpos 103064520
int_normalize 306509712
mantissa2nr 138493706
mpz2GEN 57768635
muliispec 5842153249
muliispec_mirror 85160124
muluispec 5600401707
muluui 222749
pari_gmp_free 1755951
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34990441
remi2n 39029382
resetloop 174328
roundr_up_ip 527357028
setloop 2999286
shiftispec 720090058
sqrispec 1031765494
sqrispec_mirror 41485563
sqrtr_abs 126700097
sqrtremi 5162113
subiispec 3022747666
subiuspec 1778783588
truncr 3659241
umodiu 1330163050
xmpn_copy 6897283
xmpn_mirror 587880048
xmpn_mirrorcopy 720099958
xmpn_zero 238093630

Generated by: LCOV version 1.16