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 30711-c92306d4b4) Lines: 683 719 95.0 %
Date: 2026-02-25 09:24:21 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 200582
muluui 222809
divis 323963
convi 440321
pari_gmp_free 1762584
setloop 2999283
truncr 3462951
sqrtremi 5128897
xmpn_copy 6854146
floorr 6946574
diviuexact 34100815
red_montgomery 34443838
divri_with_gmp 35477692
remi2n 38068858
sqrispec_mirror 40099576
icopy_ef 41528156
absdiviu_rem 51274885
mpz2GEN 57780962
divrr_with_gmp 76254422
muliispec_mirror 83385319
incpos 87372753
incloop 87786508
divis_rem 94067840
GEN2mpz 115559538
sqrtr_abs 126389686
mantissa2nr 138684121
divrr 142571929
divri 151794576
xmpn_zero 237948404
equaliispec 268375231
int_normalize 308842420
affir 405563110
diviuexact_i 431536304
roundr_up_ip 528847653
diviiexact 550841414
xmpn_mirror 586288792
xmpn_mirrorcopy 715563566
shiftispec 738317913
adduispec_offset 765939450
sqrispec 1058723948
umodiu 1348531397
subiuspec 1816343496
dvmdii 2214742169
adduispec 2833899292
subiispec 3060286669
addiispec 3377144236
cmpiispec 4013254303
muluispec 5696520440
muliispec 5927008433

Generated by: LCOV version 1.16