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 30483-b6b1f87815) Lines: 683 719 95.0 %
Date: 2025-09-12 09:24:16 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 200471
muluui 222702
divis 325450
convi 439395
pari_gmp_free 1755944
setloop 2999291
truncr 3654083
sqrtremi 5160790
xmpn_copy 6896518
floorr 7137445
diviuexact 31844009
red_montgomery 34981567
divri_with_gmp 35251490
remi2n 38976753
sqrispec_mirror 41402901
icopy_ef 41483309
absdiviu_rem 50861431
mpz2GEN 57762733
divrr_with_gmp 76354040
muliispec_mirror 85109383
divis_rem 86239957
incpos 103025821
incloop 103428113
GEN2mpz 115523213
sqrtr_abs 126568376
mantissa2nr 138413758
divrr 142825673
divri 151456955
xmpn_zero 237942155
equaliispec 269633554
int_normalize 306408749
affir 404155575
diviuexact_i 413265689
roundr_up_ip 527507722
diviiexact 533948774
xmpn_mirror 587832490
xmpn_mirrorcopy 719661382
shiftispec 720148128
adduispec_offset 764531533
sqrispec 1031535249
umodiu 1329420715
subiuspec 1779133309
dvmdii 2195678511
adduispec 2789998112
subiispec 3023177821
addiispec 3337320507
cmpiispec 3980003924
muluispec 5604031243
muliispec 5845202305

Generated by: LCOV version 1.16