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 30766-abc2a9856c) Lines: 683 719 95.0 %
Date: 2026-03-27 09:27: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 1088
pari_kernel_init 1096
incneg 66684
resetloop 174328
diviuuexact 200913
muluui 223117
divis 337079
convi 441355
pari_gmp_free 1763201
setloop 2999288
truncr 3433862
sqrtremi 5130342
xmpn_copy 6872101
floorr 6938720
diviuexact 34116261
red_montgomery 34507505
divri_with_gmp 35492626
remi2n 37974568
sqrispec_mirror 40106923
icopy_ef 41994154
absdiviu_rem 51851722
mpz2GEN 57901805
divrr_with_gmp 77860761
muliispec_mirror 83413884
incpos 87186987
incloop 87602614
divis_rem 94091835
GEN2mpz 115801590
sqrtr_abs 130356509
mantissa2nr 140940538
divrr 150264202
divri 152456932
xmpn_zero 243543022
equaliispec 267324467
int_normalize 309251668
affir 406716882
diviuexact_i 433286369
roundr_up_ip 536307385
diviiexact 552660408
xmpn_mirror 589762783
xmpn_mirrorcopy 726233356
shiftispec 741225000
adduispec_offset 765991616
sqrispec 1144205299
umodiu 1364291190
subiuspec 1824261898
dvmdii 2255049163
adduispec 2842841005
subiispec 3103433605
addiispec 3383712954
cmpiispec 4047335969
muluispec 5705408634
muliispec 5965192418

Generated by: LCOV version 1.16