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

Generated by: LCOV version 1.16