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: 683 719 95.0 %
Date: 2025-12-10 09:22:03 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115622686
absdiviu_rem 51106920
addiispec 3338600618
adduispec 2790229457
adduispec_offset 764764976
addumului 0
affir 404534402
cmpiispec 3983391811
convi 439759
diviiexact 534790298
divis 325446
divis_rem 86375366
diviuexact 31841219
diviuexact_i 413916850
diviuuexact 200460
divri 151544617
divri_with_gmp 35251375
divrr 142551072
divrr_with_gmp 76254009
dvmdii 2198260155
equaliispec 268871013
floorr 6946181
icopy_ef 41506818
incloop 103707200
incneg 66684
incpos 103306674
int_normalize 307228536
mantissa2nr 138426209
mpz2GEN 57812510
muliispec 5846425663
muliispec_mirror 83433075
muluispec 5607815400
muluui 222694
pari_gmp_free 1755987
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34979398
remi2n 39218060
resetloop 174328
roundr_up_ip 518805685
setloop 2999295
shiftispec 720515764
sqrispec 1030353811
sqrispec_mirror 40077690
sqrtr_abs 126399156
sqrtremi 5162678
subiispec 3024787356
subiuspec 1780671921
truncr 3456923
umodiu 1328623396
xmpn_copy 6897532
xmpn_mirror 584905416
xmpn_mirrorcopy 714319771
xmpn_zero 237641523

Generated by: LCOV version 1.16