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 30480-572da319a6) Lines: 683 719 95.0 %
Date: 2025-08-25 09:24:04 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 200472
muluui 222699
divis 325465
convi 439348
pari_gmp_free 1755958
setloop 2999279
truncr 3649555
sqrtremi 5160686
xmpn_copy 6896471
floorr 7134779
diviuexact 31840041
red_montgomery 34988348
divri_with_gmp 35251179
remi2n 39104933
sqrispec_mirror 41404993
icopy_ef 41479083
absdiviu_rem 50856113
mpz2GEN 57758455
divrr_with_gmp 76349007
muliispec_mirror 85106326
divis_rem 86242891
incpos 103403140
incloop 103806198
GEN2mpz 115514311
sqrtr_abs 126566342
mantissa2nr 138413437
divrr 142821846
divri 151455839
xmpn_zero 237934903
equaliispec 269633364
int_normalize 306630215
affir 404173933
diviuexact_i 413140585
roundr_up_ip 527489458
diviiexact 533843810
xmpn_mirror 587883183
xmpn_mirrorcopy 719635191
shiftispec 720050341
adduispec_offset 764806573
sqrispec 1031441801
umodiu 1329575592
subiuspec 1778782503
dvmdii 2195715200
adduispec 2789277707
subiispec 3022670714
addiispec 3336404824
cmpiispec 3979644491
muluispec 5601062617
muliispec 5842937306

Generated by: LCOV version 1.16