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 30595-a3cd9a95e8) Lines: 683 719 95.0 %
Date: 2026-01-04 09:21:39 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115601721
absdiviu_rem 51085287
addiispec 3333299342
adduispec 2791578479
adduispec_offset 765129015
addumului 0
affir 404377085
cmpiispec 3973760909
convi 439789
diviiexact 534083109
divis 323921
divis_rem 86361746
diviuexact 31786246
diviuexact_i 413149986
diviuuexact 200500
divri 151539626
divri_with_gmp 35250616
divrr 142549604
divrr_with_gmp 76248539
dvmdii 2191169103
equaliispec 267838313
floorr 6942624
icopy_ef 41491075
incloop 103626577
incneg 66684
incpos 103224690
int_normalize 308492193
mantissa2nr 138408833
mpz2GEN 57802056
muliispec 5837323092
muliispec_mirror 83315710
muluispec 5605386393
muluui 222734
pari_gmp_free 1735790
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34322464
remi2n 37663403
resetloop 174328
roundr_up_ip 519017632
setloop 2999293
shiftispec 713693956
sqrispec 1023726103
sqrispec_mirror 40092154
sqrtr_abs 126377171
sqrtremi 5128625
subiispec 3017158081
subiuspec 1779021487
truncr 3454086
umodiu 1331808925
xmpn_copy 6832802
xmpn_mirror 584909243
xmpn_mirrorcopy 714296841
xmpn_zero 237662726

Generated by: LCOV version 1.16