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 30601-812dd05845) Lines: 683 719 95.0 %
Date: 2026-01-06 09:22:34 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115536846
absdiviu_rem 51272535
addiispec 3332912248
adduispec 2786783481
adduispec_offset 765025346
addumului 0
affir 405142012
cmpiispec 3974623389
convi 439784
diviiexact 534450434
divis 323934
divis_rem 86370099
diviuexact 31783269
diviuexact_i 413561852
diviuuexact 200449
divri 151792963
divri_with_gmp 35478752
divrr 142546590
divrr_with_gmp 76245533
dvmdii 2191690116
equaliispec 267834810
floorr 6944782
icopy_ef 41524206
incloop 103994015
incneg 66684
incpos 103584733
int_normalize 308392133
mantissa2nr 138651563
mpz2GEN 57769590
muliispec 5837731314
muliispec_mirror 83276033
muluispec 5606320568
muluui 222673
pari_gmp_free 1762884
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34283150
remi2n 37966813
resetloop 174328
roundr_up_ip 519132384
setloop 2999294
shiftispec 713757692
sqrispec 1023514994
sqrispec_mirror 40091410
sqrtr_abs 126373514
sqrtremi 5128728
subiispec 3017103684
subiuspec 1778750689
truncr 3454928
umodiu 1327642434
xmpn_copy 6836297
xmpn_mirror 585683977
xmpn_mirrorcopy 714986263
xmpn_zero 237878867

Generated by: LCOV version 1.16