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 30862-ea47bd413c) Lines: 683 719 95.0 %
Date: 2026-05-06 09:26:47 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 1092
pari_kernel_init 1100
incneg 66684
resetloop 174380
diviuuexact 200705
muluui 222939
divis 336613
convi 442464
pari_gmp_free 1763846
setloop 2999308
truncr 3476767
sqrtremi 5131786
xmpn_copy 6873549
floorr 6950363
diviuexact 34028433
red_montgomery 34561105
divri_with_gmp 35548458
remi2n 37935905
sqrispec_mirror 40082645
icopy_ef 42102034
absdiviu_rem 51859257
mpz2GEN 57962685
divrr_with_gmp 78326212
muliispec_mirror 83231090
incpos 87498065
incloop 87906161
divis_rem 94087163
GEN2mpz 115922420
sqrtr_abs 130572828
mantissa2nr 141039292
divrr 151310554
divri 152789908
xmpn_zero 244160086
equaliispec 308644463
int_normalize 309978283
affir 406633678
diviuexact_i 434035596
roundr_up_ip 536015113
diviiexact 553816572
xmpn_mirror 589173691
xmpn_mirrorcopy 727120203
shiftispec 739837983
adduispec_offset 765812738
sqrispec 1142734862
umodiu 1359924987
subiuspec 1822816113
dvmdii 2253845190
adduispec 2835091382
subiispec 3100326950
addiispec 3380029128
cmpiispec 4042530221
muluispec 5688286547
muliispec 5950163065

Generated by: LCOV version 1.16