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 30603-c72b2decfc) Lines: 683 719 95.0 %
Date: 2026-01-07 09:21:48 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 200495
muluui 222708
divis 323945
convi 439792
pari_gmp_free 1762888
setloop 2999292
truncr 3454085
sqrtremi 5128663
xmpn_copy 6836543
floorr 6944478
diviuexact 31780350
red_montgomery 34376348
divri_with_gmp 35477490
remi2n 38057356
sqrispec_mirror 40098628
icopy_ef 41520378
absdiviu_rem 51269885
mpz2GEN 57767842
divrr_with_gmp 76240908
muliispec_mirror 83234703
divis_rem 86359001
incpos 103298395
incloop 103702105
GEN2mpz 115533658
sqrtr_abs 126370722
mantissa2nr 138645787
divrr 142518995
divri 151790616
xmpn_zero 237888739
equaliispec 267837947
int_normalize 308732155
affir 405067046
diviuexact_i 413520894
roundr_up_ip 518865667
diviiexact 534396393
xmpn_mirror 585444682
shiftispec 714065814
xmpn_mirrorcopy 714966728
adduispec_offset 764801618
sqrispec 1024156106
umodiu 1330437230
subiuspec 1778562476
dvmdii 2191998339
adduispec 2788628052
subiispec 3017048850
addiispec 3332380580
cmpiispec 3974525282
muluispec 5604491811
muliispec 5836056535

Generated by: LCOV version 1.16