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
GEN2mpz 115919959
absdiviu_rem 51863213
addiispec 3379715526
adduispec 2837087314
adduispec_offset 765663611
addumului 0
affir 406202450
cmpiispec 4041104882
convi 442078
diviiexact 553617231
divis 336678
divis_rem 94088750
diviuexact 34028669
diviuexact_i 433825118
diviuuexact 200778
divri 152477297
divri_with_gmp 35495667
divrr 150341717
divrr_with_gmp 77906594
dvmdii 2254189846
equaliispec 308635340
floorr 6944180
icopy_ef 42097634
incloop 87590918
incneg 66684
incpos 87185376
int_normalize 310365146
mantissa2nr 140977971
mpz2GEN 57961428
muliispec 5948826400
muliispec_mirror 83208137
muluispec 5687601544
muluui 223026
pari_gmp_free 1763831
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34587349
remi2n 37893433
resetloop 174380
roundr_up_ip 535506885
setloop 2999310
shiftispec 739499598
sqrispec 1142671081
sqrispec_mirror 40079519
sqrtr_abs 130487340
sqrtremi 5130734
subiispec 3099481902
subiuspec 1822685632
truncr 3445880
umodiu 1362211350
xmpn_copy 6872467
xmpn_mirror 588706791
xmpn_mirrorcopy 725543388
xmpn_zero 243599544

Generated by: LCOV version 1.16