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 30547-1b347192b6) Lines: 683 719 95.0 %
Date: 2025-11-13 09:22:32 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115527645
absdiviu_rem 51010118
addiispec 3336824025
adduispec 2789445298
adduispec_offset 764343646
addumului 0
affir 404180574
cmpiispec 3979717267
convi 439613
diviiexact 533866639
divis 325423
divis_rem 86239911
diviuexact 31841121
diviuexact_i 413166484
diviuuexact 200475
divri 151467544
divri_with_gmp 35251711
divrr 142521479
divrr_with_gmp 76236494
dvmdii 2197013036
equaliispec 268849591
floorr 6945094
icopy_ef 41489918
incloop 103542571
incneg 66684
incpos 103135009
int_normalize 306665626
mantissa2nr 138301267
mpz2GEN 57765268
muliispec 5839993198
muliispec_mirror 83216023
muluispec 5600453956
muluui 222710
pari_gmp_free 1755959
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35058752
remi2n 39130394
resetloop 174328
roundr_up_ip 518445234
setloop 2999290
shiftispec 720150853
sqrispec 1030555701
sqrispec_mirror 40041413
sqrtr_abs 126362140
sqrtremi 5161934
subiispec 3023380645
subiuspec 1779012191
truncr 3456471
umodiu 1330662182
xmpn_copy 6897301
xmpn_mirror 584334943
xmpn_mirrorcopy 713778529
xmpn_zero 237564963

Generated by: LCOV version 1.16