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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30775-9d8a55740a) Lines: 683 719 95.0 %
Date: 2026-04-05 09:26:48 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1088
pari_kernel_init 1096
incneg 66684
resetloop 174328
diviuuexact 200772
muluui 223000
divis 337097
convi 441872
pari_gmp_free 1763208
setloop 2999290
truncr 3451675
sqrtremi 5130326
xmpn_copy 6872183
floorr 6945172
diviuexact 34100829
red_montgomery 34532995
divri_with_gmp 35490669
remi2n 37925973
sqrispec_mirror 40088636
icopy_ef 41997470
absdiviu_rem 51843082
mpz2GEN 57903670
divrr_with_gmp 77865337
muliispec_mirror 83313749
incpos 87138504
incloop 87544257
divis_rem 94097245
GEN2mpz 115805043
sqrtr_abs 130336507
mantissa2nr 140895434
divrr 150238269
divri 152456638
xmpn_zero 243426919
equaliispec 307106791
int_normalize 309877796
affir 406177539
diviuexact_i 431904511
roundr_up_ip 535678342
diviiexact 551364601
xmpn_mirror 588768902
xmpn_mirrorcopy 725373232
shiftispec 739157339
adduispec_offset 764915154
sqrispec 1142800983
umodiu 1361764320
subiuspec 1821387064
dvmdii 2254011724
adduispec 2836335965
subiispec 3099529594
addiispec 3379764577
cmpiispec 4039672222
muluispec 5685894316
muliispec 5947424122

Generated by: LCOV version 1.16