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 30764-6b81f1f3fa) Lines: 683 719 95.0 %
Date: 2026-03-24 09:26:44 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 1088
pari_kernel_init 1096
incneg 66684
resetloop 174328
diviuuexact 200871
muluui 223095
divis 337089
convi 441349
pari_gmp_free 1763217
setloop 2999286
truncr 3427799
sqrtremi 5130366
xmpn_copy 6872070
floorr 6937035
diviuexact 34112659
red_montgomery 34518498
divri_with_gmp 35492417
remi2n 37961636
sqrispec_mirror 40106773
icopy_ef 41991890
absdiviu_rem 51845522
mpz2GEN 57905931
divrr_with_gmp 77852584
muliispec_mirror 83359903
incpos 87177486
incloop 87586858
divis_rem 94092839
GEN2mpz 115809956
sqrtr_abs 130343688
mantissa2nr 140922768
divrr 150241896
divri 152454029
xmpn_zero 243514471
equaliispec 267326863
int_normalize 309347448
affir 406617724
diviuexact_i 432720241
roundr_up_ip 536189838
diviiexact 552144003
xmpn_mirror 589596268
xmpn_mirrorcopy 726110142
shiftispec 740719646
adduispec_offset 765659587
sqrispec 1144158413
umodiu 1362957847
subiuspec 1823278870
dvmdii 2254197467
adduispec 2839516751
subiispec 3102003611
addiispec 3381767045
cmpiispec 4044443805
muluispec 5698824398
muliispec 5958653497

Generated by: LCOV version 1.16