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 30604-e5d817ee12) Lines: 683 719 95.0 %
Date: 2026-01-10 09:22:24 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 200490
muluui 222716
divis 323944
convi 439785
pari_gmp_free 1762895
setloop 2999294
truncr 3461628
sqrtremi 5128883
xmpn_copy 6836544
floorr 6946823
diviuexact 31784895
red_montgomery 34352833
divri_with_gmp 35477766
remi2n 38018567
sqrispec_mirror 40097081
icopy_ef 41528029
absdiviu_rem 51268578
mpz2GEN 57770125
divrr_with_gmp 76246542
muliispec_mirror 83227581
divis_rem 86378385
incpos 103469260
incloop 103871805
GEN2mpz 115538038
sqrtr_abs 126370007
mantissa2nr 138652554
divrr 142533975
divri 151791346
xmpn_zero 237885528
equaliispec 267841941
int_normalize 308674043
affir 405158653
diviuexact_i 413509229
roundr_up_ip 518978081
diviiexact 534409579
xmpn_mirror 585552701
shiftispec 713992249
xmpn_mirrorcopy 714993841
adduispec_offset 764913604
sqrispec 1023901117
umodiu 1328929682
subiuspec 1778561807
dvmdii 2192144067
adduispec 2787231506
subiispec 3016990252
addiispec 3332512032
cmpiispec 3974602709
muluispec 5604449254
muliispec 5836133602

Generated by: LCOV version 1.16