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

Generated by: LCOV version 1.16