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-11-14 17:03:41 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1092
pari_kernel_init 1100
incneg 66684
resetloop 174380
diviuuexact 200898
muluui 223122
divis 336631
convi 447825
pari_gmp_free 1632825
truncr 2530537
setloop 2999277
sqrtremi 5137721
floorr 6429971
xmpn_copy 7066408
diviuexact 34277376
red_montgomery 34723587
divri_with_gmp 35425249
remi2n 38468836
sqrispec_mirror 42195893
icopy_ef 42974000
absdiviu_rem 52878084
mpz2GEN 58509128
incpos 62544813
incloop 62948149
divrr_with_gmp 78684154
muliispec_mirror 86836601
divis_rem 94403600
GEN2mpz 117018256
sqrtr_abs 131567295
mantissa2nr 142729123
divrr 151749824
divri 161199960
xmpn_zero 245676698
equaliispec 310392748
int_normalize 322760232
affir 422158697
diviuexact_i 441838905
diviiexact 561374408
roundr_up_ip 562369420
xmpn_mirror 609297810
xmpn_mirrorcopy 742261930
shiftispec 763758343
adduispec_offset 774952501
sqrispec 1082838985
umodiu 1374540252
subiuspec 1873752590
dvmdii 2314574745
adduispec 2911004385
subiispec 3277171167
addiispec 3497743592
cmpiispec 4254808868
muluispec 5942907942
muliispec 6212813443

Generated by: LCOV version 2.0-1