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 30703-cd958ce78c) Lines: 683 719 95.0 %
Date: 2026-02-23 09:22:43 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 1108
pari_kernel_init 1116
incneg 66684
resetloop 174328
diviuuexact 200597
muluui 222821
divis 323957
convi 440306
pari_gmp_free 1763712
setloop 2999289
truncr 3457684
sqrtremi 5128869
xmpn_copy 6854112
floorr 6946715
diviuexact 31786054
red_montgomery 34398025
divri_with_gmp 35478385
remi2n 38032536
sqrispec_mirror 40122290
icopy_ef 41525071
absdiviu_rem 51272440
mpz2GEN 57778875
divrr_with_gmp 76248323
muliispec_mirror 83326921
divis_rem 86374354
incpos 103168200
incloop 103566200
GEN2mpz 115555547
sqrtr_abs 126389877
mantissa2nr 138684618
divrr 142556409
divri 151792942
xmpn_zero 237955695
equaliispec 268304683
int_normalize 309121416
diviuexact_i 400571932
affir 405415496
roundr_up_ip 519227785
diviiexact 521466307
xmpn_mirror 586037150
shiftispec 708176278
xmpn_mirrorcopy 715513218
adduispec_offset 765327596
sqrispec 1026838373
umodiu 1329503741
subiuspec 1768905576
dvmdii 2200200152
adduispec 2776771488
subiispec 3012108441
addiispec 3322644854
cmpiispec 3955217808
muluispec 5578750076
muliispec 5810790319

Generated by: LCOV version 1.16