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 30660-09c6d0ed2e) Lines: 683 719 95.0 %
Date: 2026-02-02 09:23:03 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 200509
muluui 222746
divis 323935
convi 439875
pari_gmp_free 1763108
setloop 2999294
truncr 3461195
sqrtremi 5128789
xmpn_copy 6836309
floorr 6945793
diviuexact 31786359
red_montgomery 34341137
divri_with_gmp 35478962
remi2n 38110554
sqrispec_mirror 40100896
icopy_ef 41527154
absdiviu_rem 51261003
mpz2GEN 57770851
divrr_with_gmp 76251921
muliispec_mirror 83414854
divis_rem 86380104
incpos 103435622
incloop 103848685
GEN2mpz 115539743
sqrtr_abs 126379373
mantissa2nr 138667674
divrr 142559892
divri 151794983
xmpn_zero 237922112
equaliispec 267842713
int_normalize 308689947
affir 405509581
diviuexact_i 413825697
roundr_up_ip 519455613
diviiexact 534695652
xmpn_mirror 586293903
shiftispec 714589596
xmpn_mirrorcopy 715559266
adduispec_offset 765886096
sqrispec 1024986753
umodiu 1329427253
subiuspec 1776383460
dvmdii 2195481986
adduispec 2788182162
subiispec 3014267081
addiispec 3331934871
cmpiispec 3972570641
muluispec 5601167686
muliispec 5832132775

Generated by: LCOV version 1.16