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 30552-d1d0643eee) Lines: 683 719 95.0 %
Date: 2025-11-21 09:22:16 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 200462
muluui 222705
divis 325429
convi 439604
pari_gmp_free 1755961
setloop 2999295
truncr 3453612
sqrtremi 5162172
xmpn_copy 6897089
floorr 6943999
diviuexact 31837938
red_montgomery 35071111
divri_with_gmp 35251891
remi2n 39061256
sqrispec_mirror 40035036
icopy_ef 41491572
absdiviu_rem 51016322
mpz2GEN 57766173
divrr_with_gmp 76235701
muliispec_mirror 83261139
divis_rem 86231257
incpos 103168473
incloop 103578478
GEN2mpz 115529836
sqrtr_abs 126364403
mantissa2nr 138302753
divrr 142519388
divri 151467308
xmpn_zero 237562367
equaliispec 268857984
int_normalize 307120433
affir 404197294
diviuexact_i 413099391
roundr_up_ip 518430027
diviiexact 533810036
xmpn_mirror 584332476
xmpn_mirrorcopy 713786248
shiftispec 720024334
adduispec_offset 764477599
sqrispec 1030512888
umodiu 1329231269
subiuspec 1778912453
dvmdii 2196593079
adduispec 2787759977
subiispec 3023174938
addiispec 3336335515
cmpiispec 3979311958
muluispec 5599240393
muliispec 5839273325

Generated by: LCOV version 1.16