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 30573-61accf17c8) Lines: 683 719 95.0 %
Date: 2025-12-16 09:22:09 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 200481
muluui 222718
divis 325454
convi 439770
pari_gmp_free 1755990
setloop 2999294
truncr 3456983
sqrtremi 5162738
xmpn_copy 6897604
floorr 6947111
diviuexact 31840577
red_montgomery 34960135
divri_with_gmp 35251422
remi2n 39188425
sqrispec_mirror 40100965
icopy_ef 41503100
absdiviu_rem 51098365
mpz2GEN 57807432
divrr_with_gmp 76255196
muliispec_mirror 83371446
divis_rem 86372650
incpos 103313792
incloop 103717568
GEN2mpz 115612669
sqrtr_abs 126402329
mantissa2nr 138431574
divrr 142557341
divri 151544655
xmpn_zero 237653309
equaliispec 268871464
int_normalize 307194950
affir 404556028
diviuexact_i 413851727
roundr_up_ip 518853559
diviiexact 534727784
xmpn_mirror 584974047
xmpn_mirrorcopy 714318684
shiftispec 720568322
adduispec_offset 764653989
sqrispec 1030912868
umodiu 1329440737
subiuspec 1780467649
dvmdii 2198694816
adduispec 2790903381
subiispec 3025456691
addiispec 3338489767
cmpiispec 3984309911
muluispec 5607263048
muliispec 5846535364

Generated by: LCOV version 1.16