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-03-30 09:27:24 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 200775
muluui 223017
divis 337094
convi 441863
pari_gmp_free 1763198
setloop 2999290
truncr 3453637
sqrtremi 5130239
xmpn_copy 6872561
floorr 6945587
diviuexact 34101701
red_montgomery 34557448
divri_with_gmp 35491792
remi2n 37886716
sqrispec_mirror 40079609
icopy_ef 41999132
absdiviu_rem 51843275
mpz2GEN 57902862
divrr_with_gmp 77872729
muliispec_mirror 83197847
incpos 87038498
incloop 87448928
divis_rem 94094761
GEN2mpz 115803393
sqrtr_abs 130328035
mantissa2nr 140900228
divrr 150249256
divri 152458958
xmpn_zero 243456370
equaliispec 307108418
int_normalize 310158523
affir 406230685
diviuexact_i 431760363
roundr_up_ip 535913282
diviiexact 551245508
xmpn_mirror 588807553
xmpn_mirrorcopy 725295719
shiftispec 738945238
adduispec_offset 765039886
sqrispec 1141827021
umodiu 1360720457
subiuspec 1821781140
dvmdii 2252846216
adduispec 2834345119
subiispec 3098323636
addiispec 3379254970
cmpiispec 4038128815
muluispec 5687257688
muliispec 5948278771

Generated by: LCOV version 1.16