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 29877-9124a6ce27) Lines: 683 719 95.0 %
Date: 2025-01-18 09:08:44 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115240129
absdiviu_rem 105104582
addiispec 3262701404
adduispec 2586604525
adduispec_offset 579527070
addumului 0
affir 400344120
cmpiispec 3829011311
convi 437059
diviiexact 504441581
divis 966672
divis_rem 85167481
diviuexact 30724016
diviuexact_i 386421743
diviuuexact 199475
divri 150174686
divri_with_gmp 35167797
divrr 141775234
divrr_with_gmp 75725168
dvmdii 1908171356
equaliispec 269714078
floorr 6978844
icopy_ef 41183612
incloop 99585940
incneg 66652
incpos 99171274
int_normalize 302211114
mantissa2nr 137164713
mpz2GEN 57621218
muliispec 5775687913
muliispec_mirror 83794151
muluispec 5445288160
muluui 221683
pari_gmp_free 1742360
pari_gmp_realloc 0
pari_kernel_close 1088
pari_kernel_init 1096
pari_kernel_version 4
red_montgomery 36712310
remi2n 36051652
resetloop 174328
roundr_up_ip 521136740
setloop 2997445
shiftispec 704755680
sqrispec 986232467
sqrispec_mirror 41376422
sqrtr_abs 125128865
sqrtremi 5110935
subiispec 2946856799
subiuspec 1719601438
truncr 3544269
umodiu 1291618970
xmpn_copy 6874200
xmpn_mirror 582571606
xmpn_mirrorcopy 712251044
xmpn_zero 235791096

Generated by: LCOV version 1.16