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 30556-bb9f5f8fc8) Lines: 683 719 95.0 %
Date: 2025-11-25 09:20:50 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 200450
muluui 222688
divis 325313
convi 438728
pari_gmp_free 1755886
setloop 2999194
truncr 3418473
sqrtremi 5140994
xmpn_copy 6873845
floorr 6916147
diviuexact 31620003
red_montgomery 35052513
divri_with_gmp 35211359
remi2n 38938084
sqrispec_mirror 39992251
icopy_ef 40479809
absdiviu_rem 50764897
mpz2GEN 56767465
divrr_with_gmp 76095335
muliispec_mirror 83110401
divis_rem 85255730
incpos 103023198
incloop 103427849
GEN2mpz 113532389
sqrtr_abs 126068898
mantissa2nr 137739396
divrr 142165807
divri 151367323
xmpn_zero 237093718
equaliispec 265256168
int_normalize 304201447
affir 400693743
diviuexact_i 405749104
diviiexact 509737147
roundr_up_ip 517584218
xmpn_mirror 581561296
xmpn_mirrorcopy 712380406
shiftispec 716384480
adduispec_offset 762535307
sqrispec 1028626889
umodiu 1226847668
subiuspec 1751537689
dvmdii 2169970002
adduispec 2754894605
subiispec 2986764726
addiispec 3296969180
cmpiispec 3934075039
muluispec 5534595082
muliispec 5777846876

Generated by: LCOV version 1.16