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 30573-61accf17c8) Lines: 683 719 95.0 %
Date: 2025-12-15 09:22:15 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 1104
pari_kernel_init 1112
incneg 66684
resetloop 174328
diviuuexact 200482
muluui 222727
divis 325454
convi 439777
pari_gmp_free 1755992
setloop 2999295
truncr 3458728
sqrtremi 5162751
xmpn_copy 6897562
floorr 6945987
diviuexact 31839833
red_montgomery 34996032
divri_with_gmp 35250518
remi2n 39122568
sqrispec_mirror 40104520
icopy_ef 41503790
absdiviu_rem 51104945
mpz2GEN 57808767
divrr_with_gmp 76255568
muliispec_mirror 83397405
divis_rem 86385505
incpos 103221465
incloop 103622084
GEN2mpz 115615228
sqrtr_abs 126397329
mantissa2nr 138421144
divrr 142548019
divri 151543447
xmpn_zero 237643634
equaliispec 268875328
int_normalize 307192869
affir 404505058
diviuexact_i 413819612
roundr_up_ip 518797091
diviiexact 534711609
xmpn_mirror 584916963
xmpn_mirrorcopy 714313693
shiftispec 720363530
adduispec_offset 764777166
sqrispec 1030409846
umodiu 1328788565
subiuspec 1780501443
dvmdii 2198324829
adduispec 2789963946
subiispec 3024906756
addiispec 3338104431
cmpiispec 3983406061
muluispec 5607042299
muliispec 5846689607

Generated by: LCOV version 1.16