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 30773-2078653b96) Lines: 683 719 95.0 %
Date: 2026-04-04 09:27:12 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 200702
muluui 222963
divis 337086
convi 441864
pari_gmp_free 1763204
setloop 2999289
truncr 3444213
sqrtremi 5130288
xmpn_copy 6873024
floorr 6941609
diviuexact 34100376
red_montgomery 34524306
divri_with_gmp 35492070
remi2n 37860859
sqrispec_mirror 40079785
icopy_ef 41993289
absdiviu_rem 51838925
mpz2GEN 57904742
divrr_with_gmp 77864367
muliispec_mirror 83219852
incpos 87081742
incloop 87492860
divis_rem 94096973
GEN2mpz 115806860
sqrtr_abs 130327400
mantissa2nr 140895169
divrr 150237610
divri 152457649
xmpn_zero 243448343
equaliispec 307106839
int_normalize 310360464
affir 406188133
diviuexact_i 431892016
roundr_up_ip 535913075
diviiexact 551360413
xmpn_mirror 588817038
xmpn_mirrorcopy 725317651
shiftispec 739029704
adduispec_offset 765023461
sqrispec 1141789387
umodiu 1361375525
subiuspec 1821882337
dvmdii 2252462175
adduispec 2835468508
subiispec 3098401118
addiispec 3379141190
cmpiispec 4038424187
muluispec 5685541736
muliispec 5946578196

Generated by: LCOV version 1.16