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 30571-c0dfe82732) Lines: 688 719 95.7 %
Date: 2025-12-08 09:22:00 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115619475
absdiviu_rem 51102007
addiispec 3338169923
adduispec 2789687765
adduispec_offset 764521805
addumului 0
affir 404491381
cmpiispec 3982899532
convi 439764
diviiexact 534717586
divis 325451
divis_rem 86365798
diviuexact 31838887
diviuexact_i 413844412
diviuuexact 200497
divri 151544904
divri_with_gmp 35250982
divrr 142547425
divrr_with_gmp 76253461
dvmdii 2197608478
equaliispec 268868446
floorr 6946505
icopy_ef 41505061
incloop 103657452
incneg 66684
incpos 103255570
int_normalize 307127910
mantissa2nr 138414707
mpz2GEN 57810888
muliispec 5845866633
muliispec_mirror 83331265
muluispec 5607123186
muluui 222711
pari_gmp_free 1755992
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34995796
remi2n 39181208
resetloop 174328
roundr_up_ip 518795122
setloop 2999292
shiftispec 720291123
sqrispec 1030134061
sqrispec_mirror 40083567
sqrtr_abs 126392935
sqrtremi 5162733
subiispec 3024516533
subiuspec 1780581348
truncr 3458993
umodiu 1328330272
xmpn_copy 6897347
xmpn_mirror 584809266
xmpn_mirrorcopy 714131083
xmpn_zero 237623623

Generated by: LCOV version 1.16