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 30552-d1d0643eee) Lines: 683 719 95.0 %
Date: 2025-11-24 09:22:36 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 200485
muluui 222739
divis 325432
convi 439614
pari_gmp_free 1755960
setloop 2999293
truncr 3433948
sqrtremi 5162117
xmpn_copy 6896986
floorr 6936093
diviuexact 31837575
red_montgomery 35070020
divri_with_gmp 35251830
remi2n 39009812
sqrispec_mirror 40028837
icopy_ef 41485022
absdiviu_rem 51014480
mpz2GEN 57764119
divrr_with_gmp 76216821
muliispec_mirror 83203726
divis_rem 86215909
incpos 103174676
incloop 103581948
GEN2mpz 115525602
sqrtr_abs 126365032
mantissa2nr 138301031
divrr 142492270
divri 151461207
xmpn_zero 237544352
equaliispec 268856860
int_normalize 307259967
affir 404105030
diviuexact_i 413168800
roundr_up_ip 518385350
diviiexact 533866930
xmpn_mirror 584213810
xmpn_mirrorcopy 713672499
shiftispec 720160110
adduispec_offset 764459741
sqrispec 1030637937
umodiu 1328996188
subiuspec 1778848680
dvmdii 2196582488
adduispec 2787919275
subiispec 3023318559
addiispec 3336589394
cmpiispec 3979572138
muluispec 5599606493
muliispec 5839380041

Generated by: LCOV version 1.16