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
GEN2mpz 115526156
absdiviu_rem 50996092
addiispec 3337244917
adduispec 2790982413
adduispec_offset 764216658
addumului 0
affir 404285044
cmpiispec 3980603128
convi 439746
diviiexact 533938314
divis 325417
divis_rem 86244246
diviuexact 31838833
diviuexact_i 413248643
diviuuexact 200457
divri 151467350
divri_with_gmp 35251155
divrr 142529155
divrr_with_gmp 76236731
dvmdii 2197180437
equaliispec 268857560
floorr 6944499
icopy_ef 41492419
incloop 103571483
incneg 66684
incpos 103163219
int_normalize 307505817
mantissa2nr 138310991
mpz2GEN 57764327
muliispec 5839776104
muliispec_mirror 83283459
muluispec 5600171492
muluui 222703
pari_gmp_free 1755959
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35093659
remi2n 39013119
resetloop 174328
roundr_up_ip 518477071
setloop 2999293
shiftispec 720268645
sqrispec 1031301490
sqrispec_mirror 40048761
sqrtr_abs 126362632
sqrtremi 5162131
subiispec 3024236321
subiuspec 1779074810
truncr 3455480
umodiu 1332256714
xmpn_copy 6897145
xmpn_mirror 584454759
xmpn_mirrorcopy 713760659
xmpn_zero 237562533

Generated by: LCOV version 1.16