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 30587-f85873d515) Lines: 684 719 95.1 %
Date: 2025-12-29 09:21:39 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115610493
absdiviu_rem 51092675
addiispec 3335044642
adduispec 2789565601
adduispec_offset 764799239
addumului 0
affir 404450539
cmpiispec 3977069394
convi 439784
diviiexact 534156681
divis 323936
divis_rem 86369429
diviuexact 31787461
diviuexact_i 413250711
diviuuexact 200477
divri 151538509
divri_with_gmp 35250670
divrr 142545323
divrr_with_gmp 76252007
dvmdii 2193833125
equaliispec 268814913
floorr 6945383
icopy_ef 41494802
incloop 103903386
incneg 66684
incpos 103505990
int_normalize 309260760
mantissa2nr 138401105
mpz2GEN 57806362
muliispec 5838532644
muliispec_mirror 83336297
muluispec 5606560849
muluui 222711
pari_gmp_free 1735802
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34430838
remi2n 37860796
resetloop 174328
roundr_up_ip 518704807
setloop 2999290
shiftispec 713773598
sqrispec 1025227167
sqrispec_mirror 40086273
sqrtr_abs 126381973
sqrtremi 5159934
subiispec 3020085534
subiuspec 1780553989
truncr 3457404
umodiu 1330033036
xmpn_copy 6832565
xmpn_mirror 584878642
xmpn_mirrorcopy 714331521
xmpn_zero 237625013

Generated by: LCOV version 1.16