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

Generated by: LCOV version 1.16