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-03 09:26:58 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 200827
muluui 223049
divis 337100
convi 441864
pari_gmp_free 1763212
setloop 2999289
truncr 3450275
sqrtremi 5130253
xmpn_copy 6872462
floorr 6942456
diviuexact 34100662
red_montgomery 34528825
divri_with_gmp 35491936
remi2n 37923422
sqrispec_mirror 40080085
icopy_ef 41993111
absdiviu_rem 51841383
mpz2GEN 57899889
divrr_with_gmp 77870346
muliispec_mirror 83190729
incpos 87009593
incloop 87424540
divis_rem 94097780
GEN2mpz 115797301
sqrtr_abs 130326110
mantissa2nr 140898035
divrr 150249394
divri 152458784
xmpn_zero 243456869
equaliispec 307107438
int_normalize 310008870
affir 406210063
diviuexact_i 431798205
roundr_up_ip 535906381
diviiexact 551285079
xmpn_mirror 588819175
xmpn_mirrorcopy 725344997
shiftispec 738940627
adduispec_offset 764987902
sqrispec 1141773548
umodiu 1360822004
subiuspec 1821776323
dvmdii 2252778285
adduispec 2834199101
subiispec 3098271685
addiispec 3378924270
cmpiispec 4038075376
muluispec 5685460587
muliispec 5946765789

Generated by: LCOV version 1.16