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 30711-c92306d4b4) Lines: 683 719 95.0 %
Date: 2026-02-24 09:25:14 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 1084
pari_kernel_init 1092
incneg 66684
resetloop 174328
diviuuexact 200574
muluui 222792
divis 323956
convi 440313
pari_gmp_free 1762577
setloop 2999282
truncr 3437820
sqrtremi 5128874
xmpn_copy 6853685
floorr 6939913
diviuexact 34102689
red_montgomery 34474748
divri_with_gmp 35479231
remi2n 38028435
sqrispec_mirror 40117115
icopy_ef 41520110
absdiviu_rem 51271742
mpz2GEN 57780833
divrr_with_gmp 76234753
muliispec_mirror 83387124
incpos 87359083
incloop 87771834
divis_rem 94053913
GEN2mpz 115559649
sqrtr_abs 126389715
mantissa2nr 138684742
divrr 142553597
divri 151790527
xmpn_zero 237940572
equaliispec 268370505
int_normalize 308875323
affir 405551077
diviuexact_i 431521709
roundr_up_ip 528947864
diviiexact 550857919
xmpn_mirror 586367566
xmpn_mirrorcopy 715608084
shiftispec 738257834
adduispec_offset 766163741
sqrispec 1058535496
umodiu 1346532324
subiuspec 1816118789
dvmdii 2214888054
adduispec 2832147055
subiispec 3060001332
addiispec 3377005760
cmpiispec 4013482609
muluispec 5698089204
muliispec 5929291334

Generated by: LCOV version 1.16