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 30640-c2c58e18c5) Lines: 683 719 95.0 %
Date: 2026-01-27 08:51:18 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 200518
muluui 222724
divis 316157
convi 439039
pari_gmp_free 1297496
setloop 2996732
truncr 3252151
sqrtremi 5011943
xmpn_copy 6608940
floorr 6701945
diviuexact 31579825
red_montgomery 34212251
divri_with_gmp 34992404
remi2n 36367803
sqrispec_mirror 40044260
icopy_ef 41315892
absdiviu_rem 50490533
mpz2GEN 57332377
divrr_with_gmp 74392895
muliispec_mirror 83142329
divis_rem 84030879
incpos 103152594
incloop 103544701
GEN2mpz 114662339
sqrtr_abs 121469073
mantissa2nr 130017117
divrr 137274858
divri 150290280
xmpn_zero 230654925
equaliispec 264171899
int_normalize 292765503
affir 386286757
diviuexact_i 398401016
roundr_up_ip 507586499
diviiexact 515518642
xmpn_mirror 562338499
shiftispec 679769506
xmpn_mirrorcopy 699140369
adduispec_offset 707066099
sqrispec 1006566493
umodiu 1217565488
subiuspec 1728765078
dvmdii 2122008724
adduispec 2694928836
subiispec 2939796547
addiispec 3268527110
cmpiispec 3870778905
muluispec 5481066255
muliispec 5720250152

Generated by: LCOV version 1.16