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 30773-2078653b96) Lines: 683 719 95.0 %
Date: 2026-04-02 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
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1088
pari_kernel_init 1096
incneg 66684
resetloop 174328
diviuuexact 200745
muluui 222984
divis 337096
convi 441871
pari_gmp_free 1763199
setloop 2999290
truncr 3454915
sqrtremi 5130304
xmpn_copy 6872325
floorr 6944723
diviuexact 34098539
red_montgomery 34476016
divri_with_gmp 35492312
remi2n 37911487
sqrispec_mirror 40075366
icopy_ef 42001225
absdiviu_rem 51850448
mpz2GEN 57902845
divrr_with_gmp 77873742
muliispec_mirror 83175000
incpos 87053431
incloop 87462446
divis_rem 94108505
GEN2mpz 115802775
sqrtr_abs 130330915
mantissa2nr 140907288
divrr 150255657
divri 152461076
xmpn_zero 243465229
equaliispec 307111255
int_normalize 309968377
affir 406237036
diviuexact_i 431853530
roundr_up_ip 535926460
diviiexact 551335514
xmpn_mirror 588882594
xmpn_mirrorcopy 725328798
shiftispec 738966558
adduispec_offset 765155645
sqrispec 1141577004
umodiu 1362693828
subiuspec 1821980771
dvmdii 2252342894
adduispec 2836790172
subiispec 3098220028
addiispec 3379040492
cmpiispec 4038108895
muluispec 5685711530
muliispec 5946849830

Generated by: LCOV version 1.16