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-09-20 17:03:12 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 336637
convi 447828
pari_gmp_free 1632819
truncr 2530456
setloop 2999288
sqrtremi 5137858
floorr 6429830
xmpn_copy 7066539
diviuexact 34277406
red_montgomery 34724010
divri_with_gmp 35425621
remi2n 38596037
sqrispec_mirror 42195509
icopy_ef 42976918
absdiviu_rem 52884528
mpz2GEN 58509607
incpos 63994721
incloop 64398057
divrr_with_gmp 78685707
muliispec_mirror 86836573
divis_rem 94402940
GEN2mpz 117019214
sqrtr_abs 131574028
mantissa2nr 142737831
divrr 151751546
divri 161202041
xmpn_zero 245685356
equaliispec 310394084
int_normalize 322828504
affir 422218593
diviuexact_i 441878730
diviiexact 561417080
roundr_up_ip 562386502
xmpn_mirror 609346052
xmpn_mirrorcopy 742282304
shiftispec 763757709
adduispec_offset 775208766
sqrispec 1082483717
umodiu 1373794225
subiuspec 1874017205
dvmdii 2314306824
adduispec 2910415991
subiispec 3276917463
addiispec 3497747393
cmpiispec 4255780104
muluispec 5943286876
muliispec 6213121504

Generated by: LCOV version 2.0-1