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 30674-be81ecfdd4) Lines: 683 719 95.0 %
Date: 2026-02-09 09:23:39 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 200490
muluui 222714
divis 323963
convi 439945
pari_gmp_free 1763116
setloop 2999293
truncr 3456353
sqrtremi 5128801
xmpn_copy 6836424
floorr 6944044
diviuexact 31787667
red_montgomery 34352246
divri_with_gmp 35479055
remi2n 38052170
sqrispec_mirror 40090584
icopy_ef 41524674
absdiviu_rem 51269960
mpz2GEN 57776819
divrr_with_gmp 76246052
muliispec_mirror 83398634
divis_rem 86381079
incpos 103043640
incloop 103451365
GEN2mpz 115551344
sqrtr_abs 126384338
mantissa2nr 138677603
divrr 142560765
divri 151795337
xmpn_zero 237920346
equaliispec 267759711
int_normalize 308942592
affir 405430922
diviuexact_i 413648731
roundr_up_ip 519442683
diviiexact 534548567
xmpn_mirror 586278730
shiftispec 714745802
xmpn_mirrorcopy 715457194
adduispec_offset 765936747
sqrispec 1025676064
umodiu 1330792395
subiuspec 1776798780
dvmdii 2196213376
adduispec 2789801980
subiispec 3015852310
addiispec 3332979811
cmpiispec 3973985555
muluispec 5602075673
muliispec 5830975633

Generated by: LCOV version 1.16