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 30584-b9873745ba) Lines: 683 719 95.0 %
Date: 2025-12-22 09:21:19 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115608545
absdiviu_rem 51097228
addiispec 3334458829
adduispec 2790207246
adduispec_offset 764508598
addumului 0
affir 404488823
cmpiispec 3975736627
convi 439787
diviiexact 534017349
divis 323934
divis_rem 86371799
diviuexact 31783827
diviuexact_i 413093066
diviuuexact 200416
divri 151541826
divri_with_gmp 35251438
divrr 142564980
divrr_with_gmp 76260424
dvmdii 2192298962
equaliispec 268810027
floorr 6949132
icopy_ef 41498328
incloop 103774921
incneg 66684
incpos 103366637
int_normalize 308863097
mantissa2nr 138414558
mpz2GEN 57805751
muliispec 5837011095
muliispec_mirror 83298099
muluispec 5604945425
muluui 222664
pari_gmp_free 1735792
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34395776
remi2n 37664210
resetloop 174328
roundr_up_ip 518726444
setloop 2999293
shiftispec 713460667
sqrispec 1024866767
sqrispec_mirror 40095708
sqrtr_abs 126390104
sqrtremi 5160107
subiispec 3019258665
subiuspec 1780171939
truncr 3464054
umodiu 1330432075
xmpn_copy 6832698
xmpn_mirror 584905966
xmpn_mirrorcopy 714301357
xmpn_zero 237640638

Generated by: LCOV version 1.16