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 30536-6f6fcf9613) Lines: 683 719 95.0 %
Date: 2025-11-01 09:21:23 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115526924
absdiviu_rem 50856594
addiispec 3335965511
adduispec 2790759573
adduispec_offset 764351563
addumului 0
affir 404181180
cmpiispec 3978947545
convi 439465
diviiexact 533861450
divis 325428
divis_rem 86227754
diviuexact 31842250
diviuexact_i 413151150
diviuuexact 200467
divri 151453566
divri_with_gmp 35249541
divrr 142508394
divrr_with_gmp 76233357
dvmdii 2196075798
equaliispec 268847766
floorr 6947287
icopy_ef 41493096
incloop 103671747
incneg 66684
incpos 103265622
int_normalize 306589552
mantissa2nr 138311468
mpz2GEN 57764680
muliispec 5838341937
muliispec_mirror 83266952
muluispec 5598884505
muluui 222708
pari_gmp_free 1755947
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34980602
remi2n 39095082
resetloop 174328
roundr_up_ip 518503259
setloop 2999285
shiftispec 719997050
sqrispec 1030217033
sqrispec_mirror 40055094
sqrtr_abs 126356804
sqrtremi 5162024
subiispec 3022176464
subiuspec 1778746258
truncr 3464471
umodiu 1331330750
xmpn_copy 6897283
xmpn_mirror 584355572
xmpn_mirrorcopy 713813208
xmpn_zero 237574903

Generated by: LCOV version 1.16