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 30569-8181146aa1) Lines: 683 719 95.0 %
Date: 2025-12-04 09:22:12 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115615963
absdiviu_rem 51094610
addiispec 3337815339
adduispec 2789554174
adduispec_offset 764435394
addumului 0
affir 404354489
cmpiispec 3982442280
convi 439754
diviiexact 534745024
divis 325450
divis_rem 86357809
diviuexact 31842279
diviuexact_i 413883520
diviuuexact 200491
divri 151538213
divri_with_gmp 35250965
divrr 142521288
divrr_with_gmp 76232984
dvmdii 2197461174
equaliispec 268860718
floorr 6940772
icopy_ef 41495691
incloop 103487658
incneg 66684
incpos 103087383
int_normalize 307122582
mantissa2nr 138407544
mpz2GEN 57809162
muliispec 5844841534
muliispec_mirror 83352890
muluispec 5605702693
muluui 222692
pari_gmp_free 1755989
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34993768
remi2n 39123147
resetloop 174328
roundr_up_ip 518716452
setloop 2999293
shiftispec 720342461
sqrispec 1030244626
sqrispec_mirror 40085990
sqrtr_abs 126389964
sqrtremi 5162704
subiispec 3024311470
subiuspec 1780473844
truncr 3437102
umodiu 1328020984
xmpn_copy 6897194
xmpn_mirror 584653459
xmpn_mirrorcopy 714047035
xmpn_zero 237597948

Generated by: LCOV version 1.16