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

Generated by: LCOV version 1.16