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-14 17:02:03 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 336639
convi 447824
pari_gmp_free 1632816
truncr 2530474
setloop 2999288
sqrtremi 5137736
floorr 6429914
xmpn_copy 7066551
diviuexact 34278290
red_montgomery 34739066
divri_with_gmp 35425342
remi2n 38639438
sqrispec_mirror 42195509
icopy_ef 42966066
absdiviu_rem 52881444
mpz2GEN 58505441
incpos 63839512
incloop 64242848
divrr_with_gmp 78684320
muliispec_mirror 86836573
divis_rem 94396708
GEN2mpz 117010882
sqrtr_abs 131569726
mantissa2nr 142726262
divrr 151746603
divri 161199224
xmpn_zero 245679388
equaliispec 310391644
int_normalize 322862922
affir 422125148
diviuexact_i 441876534
diviiexact 561412809
roundr_up_ip 562356868
xmpn_mirror 609272984
xmpn_mirrorcopy 742262527
shiftispec 763956238
adduispec_offset 775301552
sqrispec 1083123586
umodiu 1372905427
subiuspec 1873863338
dvmdii 2315532890
adduispec 2909401162
subiispec 3277713680
addiispec 3497986881
cmpiispec 4256880743
muluispec 5943001109
muliispec 6212953013

Generated by: LCOV version 2.0-1