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 30625-1bbc371a2f) Lines: 683 719 95.0 %
Date: 2026-01-23 09:24:12 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115537970
absdiviu_rem 51274986
addiispec 3333350010
adduispec 2791648699
adduispec_offset 766265877
addumului 0
affir 405571452
cmpiispec 3975883275
convi 439586
diviiexact 534802316
divis 323930
divis_rem 86382793
diviuexact 31787571
diviuexact_i 413896638
diviuuexact 200576
divri 151795623
divri_with_gmp 35478181
divrr 142575835
divrr_with_gmp 76252353
dvmdii 2196950607
equaliispec 267845026
floorr 6946158
icopy_ef 41526466
incloop 103826538
incneg 66684
incpos 103417511
int_normalize 308778250
mantissa2nr 138695453
mpz2GEN 57769913
muliispec 5837353343
muliispec_mirror 83437924
muluispec 5605895870
muluui 222791
pari_gmp_free 1762886
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34381956
remi2n 38084589
resetloop 174328
roundr_up_ip 519451397
setloop 2999283
shiftispec 715136684
sqrispec 1026149503
sqrispec_mirror 40099821
sqrtr_abs 126393367
sqrtremi 5128826
subiispec 3016003103
subiuspec 1776680663
truncr 3457627
umodiu 1332130299
xmpn_copy 6836348
xmpn_mirror 586404102
xmpn_mirrorcopy 715700173
xmpn_zero 237968001

Generated by: LCOV version 1.16