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 30563-682842a727) Lines: 683 719 95.0 %
Date: 2025-11-29 09:23:24 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 200457
muluui 222703
divis 325417
convi 439746
pari_gmp_free 1755959
setloop 2999293
truncr 3455480
sqrtremi 5162131
xmpn_copy 6897145
floorr 6944499
diviuexact 31838833
red_montgomery 35093659
divri_with_gmp 35251155
remi2n 39013119
sqrispec_mirror 40048761
icopy_ef 41492419
absdiviu_rem 50996092
mpz2GEN 57764327
divrr_with_gmp 76236731
muliispec_mirror 83283459
divis_rem 86244246
incpos 103163219
incloop 103571483
GEN2mpz 115526156
sqrtr_abs 126362632
mantissa2nr 138310991
divrr 142529155
divri 151467350
xmpn_zero 237562533
equaliispec 268857560
int_normalize 307505817
affir 404285044
diviuexact_i 413248643
roundr_up_ip 518477071
diviiexact 533938314
xmpn_mirror 584454759
xmpn_mirrorcopy 713760659
shiftispec 720268645
adduispec_offset 764216658
sqrispec 1031301490
umodiu 1332256714
subiuspec 1779074810
dvmdii 2197180437
adduispec 2790982413
subiispec 3024236321
addiispec 3337244917
cmpiispec 3980603128
muluispec 5600171492
muliispec 5839776104

Generated by: LCOV version 1.16