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

Generated by: LCOV version 1.16