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 30558-88b7dc3357) Lines: 683 719 95.0 %
Date: 2025-11-26 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
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1104
pari_kernel_init 1112
incneg 66684
resetloop 174328
diviuuexact 200474
muluui 222707
divis 325429
convi 439611
pari_gmp_free 1755960
setloop 2999295
truncr 3456272
sqrtremi 5162149
xmpn_copy 6896914
floorr 6944822
diviuexact 31840456
red_montgomery 35006492
divri_with_gmp 35251105
remi2n 39026813
sqrispec_mirror 40043770
icopy_ef 41494412
absdiviu_rem 51003413
mpz2GEN 57768248
divrr_with_gmp 76237134
muliispec_mirror 83351952
divis_rem 86238125
incpos 103184603
incloop 103589982
GEN2mpz 115534295
sqrtr_abs 126364183
mantissa2nr 138304652
divrr 142517296
divri 151467125
xmpn_zero 237569836
equaliispec 268856923
int_normalize 306771103
affir 404178292
diviuexact_i 413343067
roundr_up_ip 518555006
diviiexact 534030268
xmpn_mirror 584397091
xmpn_mirrorcopy 713877772
shiftispec 720362144
adduispec_offset 764417487
sqrispec 1030308028
umodiu 1328619259
subiuspec 1779168239
dvmdii 2196485339
adduispec 2788657563
subiispec 3023277069
addiispec 3336996229
cmpiispec 3980222249
muluispec 5602539209
muliispec 5842151613

Generated by: LCOV version 1.16