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 30316-0578a48613) Lines: 683 719 95.0 %
Date: 2025-06-02 09:19:41 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115114989
absdiviu_rem 109919643
addiispec 3320777682
adduispec 2779573357
adduispec_offset 765156995
addumului 0
affir 401164993
cmpiispec 3942775933
convi 438574
diviiexact 525922481
divis 966680
divis_rem 85228938
diviuexact 39179348
diviuexact_i 414010034
diviuuexact 200455
divri 151123201
divri_with_gmp 35237957
divrr 141833038
divrr_with_gmp 75798680
dvmdii 2177870657
equaliispec 267239086
floorr 6996285
icopy_ef 41187068
incloop 103841884
incneg 66684
incpos 103431632
int_normalize 306857388
mantissa2nr 137400704
mpz2GEN 57558859
muliispec 5920377709
muliispec_mirror 85130452
muluispec 5581827269
muluui 222696
pari_gmp_free 1744684
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34855771
remi2n 37431530
resetloop 174328
roundr_up_ip 524490588
setloop 2997603
shiftispec 704172833
sqrispec 1019785895
sqrispec_mirror 41399139
sqrtr_abs 125653494
sqrtremi 5114886
subiispec 3003359207
subiuspec 1767830813
truncr 3529761
umodiu 1304585637
xmpn_copy 6698105
xmpn_mirror 584607050
xmpn_mirrorcopy 715942235
xmpn_zero 236402119

Generated by: LCOV version 1.16