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-08-31 17:02:29 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117023866
absdiviu_rem 52881544
addiispec 3498094734
adduispec 2912436120
adduispec_offset 775197362
addumului 0
affir 422162797
cmpiispec 4256986867
convi 447821
diviiexact 561439120
divis 336639
divis_rem 94398376
diviuexact 34278531
diviuexact_i 441898462
diviuuexact 200898
divri 161200258
divri_with_gmp 35425482
divrr 151749026
divrr_with_gmp 78685875
dvmdii 2315251146
equaliispec 310392725
floorr 6429948
icopy_ef 42971912
incloop 64342547
incneg 66684
incpos 63939211
int_normalize 322817858
mantissa2nr 142730908
mpz2GEN 58511933
muliispec 6213317743
muliispec_mirror 86836573
muluispec 5943434601
muluui 223122
pari_gmp_free 1632831
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34732953
remi2n 38586649
resetloop 174380
roundr_up_ip 562375317
setloop 2999288
shiftispec 763958339
sqrispec 1083009583
sqrispec_mirror 42195542
sqrtr_abs 131570410
sqrtremi 5137806
subiispec 3277761565
subiuspec 1874041150
truncr 2530539
umodiu 1375780468
xmpn_copy 7066381
xmpn_mirror 609300620
xmpn_mirrorcopy 742271515
xmpn_zero 245681767

Generated by: LCOV version 2.0-1