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 30734-f1f26dedcb) Lines: 683 719 95.0 %
Date: 2026-03-04 09:24:31 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 1084
pari_kernel_init 1092
incneg 66684
resetloop 174328
diviuuexact 200547
muluui 222775
divis 323967
convi 440680
pari_gmp_free 1762620
setloop 2999279
truncr 3448731
sqrtremi 5129403
xmpn_copy 6854573
floorr 6942729
diviuexact 34099112
red_montgomery 34477921
divri_with_gmp 35481628
remi2n 38028149
sqrispec_mirror 40114011
icopy_ef 41507127
absdiviu_rem 51328211
mpz2GEN 57774654
divrr_with_gmp 76242595
muliispec_mirror 83355713
incpos 87157123
incloop 87562196
divis_rem 94066180
GEN2mpz 115547327
sqrtr_abs 126398662
mantissa2nr 138713812
divrr 142571150
divri 151801018
xmpn_zero 237953369
equaliispec 266942200
int_normalize 309017345
affir 405504091
diviuexact_i 431025179
roundr_up_ip 528942702
diviiexact 550313436
xmpn_mirror 586267628
xmpn_mirrorcopy 715496940
shiftispec 737906905
adduispec_offset 765043111
sqrispec 1131437961
umodiu 1344602783
subiuspec 1815443874
dvmdii 2213103702
adduispec 2831987712
subiispec 3058592036
addiispec 3376220084
cmpiispec 4012725799
muluispec 5695923719
muliispec 5926222625

Generated by: LCOV version 1.16