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 30651-3e52073f6d) Lines: 683 719 95.0 %
Date: 2026-01-28 09:23:10 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 200463
muluui 222703
divis 323935
convi 439861
pari_gmp_free 1763113
setloop 2999292
truncr 3437728
sqrtremi 5128683
xmpn_copy 6836399
floorr 6938735
diviuexact 31783961
red_montgomery 34359734
divri_with_gmp 35478857
remi2n 38125956
sqrispec_mirror 40085224
icopy_ef 41515176
absdiviu_rem 51273491
mpz2GEN 57769598
divrr_with_gmp 76227924
muliispec_mirror 83289911
divis_rem 86345537
incpos 103250234
incloop 103653105
GEN2mpz 115536990
sqrtr_abs 126364438
mantissa2nr 138640203
divrr 142508257
divri 151787889
xmpn_zero 237855401
equaliispec 267833079
int_normalize 308914748
affir 405026271
diviuexact_i 413550181
roundr_up_ip 519242394
diviiexact 534445160
xmpn_mirror 585565372
shiftispec 714045644
xmpn_mirrorcopy 714899519
adduispec_offset 765227678
sqrispec 1023895373
umodiu 1329699350
subiuspec 1775388596
dvmdii 2193065881
adduispec 2786200745
subiispec 3011193664
addiispec 3329995417
cmpiispec 3967959306
muluispec 5596073816
muliispec 5826618577

Generated by: LCOV version 1.16