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 30536-6f6fcf9613) Lines: 683 719 95.0 %
Date: 2025-11-06 09:21:54 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115519128
absdiviu_rem 50860760
addiispec 3336399819
adduispec 2789298328
adduispec_offset 764335168
addumului 0
affir 404112973
cmpiispec 3979327063
convi 439473
diviiexact 533839066
divis 325427
divis_rem 86245644
diviuexact 31842546
diviuexact_i 413138752
diviuuexact 200489
divri 151448705
divri_with_gmp 35248586
divrr 142501947
divrr_with_gmp 76228781
dvmdii 2196417726
equaliispec 268847269
floorr 6945650
icopy_ef 41488029
incloop 103671293
incneg 66684
incpos 103264955
int_normalize 306348252
mantissa2nr 138307607
mpz2GEN 57760811
muliispec 5840143231
muliispec_mirror 83280855
muluispec 5600640887
muluui 222711
pari_gmp_free 1755949
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35006737
remi2n 39032471
resetloop 174328
roundr_up_ip 518418874
setloop 2999289
shiftispec 720057713
sqrispec 1030313173
sqrispec_mirror 40049092
sqrtr_abs 126353133
sqrtremi 5161885
subiispec 3022470992
subiuspec 1778571993
truncr 3457853
umodiu 1329811288
xmpn_copy 6897287
xmpn_mirror 584302617
xmpn_mirrorcopy 713794069
xmpn_zero 237565123

Generated by: LCOV version 1.16