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
GEN2mpz 115806927
absdiviu_rem 51848818
addiispec 3378437488
adduispec 2835106864
adduispec_offset 765079090
addumului 0
affir 406234417
cmpiispec 4038001805
convi 441862
diviiexact 551274395
divis 337098
divis_rem 94097607
diviuexact 34099248
diviuexact_i 431781416
diviuuexact 200805
divri 152456607
divri_with_gmp 35491548
divrr 150230977
divrr_with_gmp 77865865
dvmdii 2252481351
equaliispec 307111135
floorr 6942752
icopy_ef 41996407
incloop 87627345
incneg 66684
incpos 87218874
int_normalize 309761368
mantissa2nr 140901153
mpz2GEN 57904566
muliispec 5946290072
muliispec_mirror 83143968
muluispec 5684572270
muluui 223043
pari_gmp_free 1763210
pari_gmp_realloc 0
pari_kernel_close 1088
pari_kernel_init 1096
pari_kernel_version 4
red_montgomery 34527712
remi2n 37858270
resetloop 174328
roundr_up_ip 535621413
setloop 2999294
shiftispec 738974205
sqrispec 1141755583
sqrispec_mirror 40092503
sqrtr_abs 130329696
sqrtremi 5130330
subiispec 3097909280
subiuspec 1821646519
truncr 3447395
umodiu 1361087019
xmpn_copy 6872208
xmpn_mirror 588727805
xmpn_mirrorcopy 725360035
xmpn_zero 243469447

Generated by: LCOV version 1.16