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 30792-987d9c52f6) Lines: 683 719 95.0 %
Date: 2026-04-09 09:26:26 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 200805
muluui 223043
divis 337098
convi 441862
pari_gmp_free 1763210
setloop 2999294
truncr 3447395
sqrtremi 5130330
xmpn_copy 6872208
floorr 6942752
diviuexact 34099248
red_montgomery 34527712
divri_with_gmp 35491548
remi2n 37858270
sqrispec_mirror 40092503
icopy_ef 41996407
absdiviu_rem 51848818
mpz2GEN 57904566
divrr_with_gmp 77865865
muliispec_mirror 83143968
incpos 87218874
incloop 87627345
divis_rem 94097607
GEN2mpz 115806927
sqrtr_abs 130329696
mantissa2nr 140901153
divrr 150230977
divri 152456607
xmpn_zero 243469447
equaliispec 307111135
int_normalize 309761368
affir 406234417
diviuexact_i 431781416
roundr_up_ip 535621413
diviiexact 551274395
xmpn_mirror 588727805
xmpn_mirrorcopy 725360035
shiftispec 738974205
adduispec_offset 765079090
sqrispec 1141755583
umodiu 1361087019
subiuspec 1821646519
dvmdii 2252481351
adduispec 2835106864
subiispec 3097909280
addiispec 3378437488
cmpiispec 4038001805
muluispec 5684572270
muliispec 5946290072

Generated by: LCOV version 1.16