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 30558-88b7dc3357) Lines: 683 719 95.0 %
Date: 2025-11-27 09:21:46 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115525760
absdiviu_rem 51009694
addiispec 3336304768
adduispec 2790222675
adduispec_offset 764373164
addumului 0
affir 404110076
cmpiispec 3979203960
convi 439601
diviiexact 533926435
divis 325428
divis_rem 86198374
diviuexact 31839090
diviuexact_i 413218513
diviuuexact 200511
divri 151462941
divri_with_gmp 35251347
divrr 142499566
divrr_with_gmp 76224897
dvmdii 2196157548
equaliispec 268851639
floorr 6939717
icopy_ef 41488676
incloop 103615056
incneg 66684
incpos 103206740
int_normalize 307104261
mantissa2nr 138310522
mpz2GEN 57764108
muliispec 5840254353
muliispec_mirror 83346332
muluispec 5600852236
muluui 222715
pari_gmp_free 1755948
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35001573
remi2n 39083935
resetloop 174328
roundr_up_ip 518554373
setloop 2999295
shiftispec 720176517
sqrispec 1030198031
sqrispec_mirror 40044278
sqrtr_abs 126368371
sqrtremi 5162162
subiispec 3022467952
subiuspec 1778726648
truncr 3439776
umodiu 1330734144
xmpn_copy 6897052
xmpn_mirror 584308599
xmpn_mirrorcopy 713818480
xmpn_zero 237558738

Generated by: LCOV version 1.16