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 30849-48ff4d246c) Lines: 683 719 95.0 %
Date: 2026-05-01 09:26:53 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 200778
muluui 223026
divis 336678
convi 442078
pari_gmp_free 1763831
setloop 2999310
truncr 3445880
sqrtremi 5130734
xmpn_copy 6872467
floorr 6944180
diviuexact 34028669
red_montgomery 34587349
divri_with_gmp 35495667
remi2n 37893433
sqrispec_mirror 40079519
icopy_ef 42097634
absdiviu_rem 51863213
mpz2GEN 57961428
divrr_with_gmp 77906594
muliispec_mirror 83208137
incpos 87185376
incloop 87590918
divis_rem 94088750
GEN2mpz 115919959
sqrtr_abs 130487340
mantissa2nr 140977971
divrr 150341717
divri 152477297
xmpn_zero 243599544
equaliispec 308635340
int_normalize 310365146
affir 406202450
diviuexact_i 433825118
roundr_up_ip 535506885
diviiexact 553617231
xmpn_mirror 588706791
xmpn_mirrorcopy 725543388
shiftispec 739499598
adduispec_offset 765663611
sqrispec 1142671081
umodiu 1362211350
subiuspec 1822685632
dvmdii 2254189846
adduispec 2837087314
subiispec 3099481902
addiispec 3379715526
cmpiispec 4041104882
muluispec 5687601544
muliispec 5948826400

Generated by: LCOV version 1.16