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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 95.0 % 718 682
Test Date: 2026-10-18 17:03:04 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117025196
absdiviu_rem 52880820
addiispec 3497909582
adduispec 2911802452
adduispec_offset 775092348
addumului 0
affir 422168861
cmpiispec 4256502918
convi 447821
diviiexact 561393053
divis 336631
divis_rem 94391133
diviuexact 34278233
diviuexact_i 441853023
diviuuexact 200898
divri 161199640
divri_with_gmp 35425283
divrr 151748508
divrr_with_gmp 78685287
dvmdii 2314912119
equaliispec 310393111
floorr 6429977
icopy_ef 42974758
incloop 64334366
incneg 66684
incpos 63931030
int_normalize 322818739
mantissa2nr 142728824
mpz2GEN 58512598
muliispec 6213016392
muliispec_mirror 86836573
muluispec 5943134315
muluui 223122
pari_gmp_free 1632830
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34725338
remi2n 38540459
resetloop 174380
roundr_up_ip 562369382
setloop 2999288
shiftispec 763833662
sqrispec 1082881116
sqrispec_mirror 42195542
sqrtr_abs 131570534
sqrtremi 5137753
subiispec 3277414519
subiuspec 1873870374
truncr 2530448
umodiu 1375261330
xmpn_copy 7066390
xmpn_mirror 609299315
xmpn_mirrorcopy 742269624
xmpn_zero 245681104

Generated by: LCOV version 2.0-1