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 30587-f85873d515) Lines: 683 719 95.0 %
Date: 2025-12-28 09:21:53 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115613474
absdiviu_rem 51088485
addiispec 3334725623
adduispec 2791894111
adduispec_offset 764797478
addumului 0
affir 404468879
cmpiispec 3976247460
convi 439779
diviiexact 534037164
divis 323942
divis_rem 86359944
diviuexact 31784364
diviuexact_i 413105821
diviuuexact 200478
divri 151539623
divri_with_gmp 35250889
divrr 142556903
divrr_with_gmp 76252399
dvmdii 2193129783
equaliispec 268814218
floorr 6947097
icopy_ef 41496294
incloop 103921816
incneg 66684
incpos 103515396
int_normalize 309149107
mantissa2nr 138414185
mpz2GEN 57807843
muliispec 5838993456
muliispec_mirror 83293665
muluispec 5606537145
muluui 222716
pari_gmp_free 1735801
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34366692
remi2n 37769703
resetloop 174328
roundr_up_ip 518710514
setloop 2999295
shiftispec 713623236
sqrispec 1024879427
sqrispec_mirror 40110530
sqrtr_abs 126389074
sqrtremi 5159953
subiispec 3019509918
subiuspec 1780231630
truncr 3457952
umodiu 1332293546
xmpn_copy 6832530
xmpn_mirror 584941250
xmpn_mirrorcopy 714348893
xmpn_zero 237640681

Generated by: LCOV version 1.16