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 30584-b9873745ba) Lines: 683 719 95.0 %
Date: 2025-12-21 09:21:02 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115602223
absdiviu_rem 51096412
addiispec 3334123820
adduispec 2788730478
adduispec_offset 764720499
addumului 0
affir 404353287
cmpiispec 3975655567
convi 439782
diviiexact 534021588
divis 323942
divis_rem 86360337
diviuexact 31784560
diviuexact_i 413109756
diviuuexact 200509
divri 151539250
divri_with_gmp 35250843
divrr 142545888
divrr_with_gmp 76250956
dvmdii 2192604782
equaliispec 268809587
floorr 6945891
icopy_ef 41491840
incloop 103704528
incneg 66684
incpos 103295926
int_normalize 309106452
mantissa2nr 138405070
mpz2GEN 57802280
muliispec 5835659345
muliispec_mirror 83303812
muluispec 5603054291
muluui 222736
pari_gmp_free 1735789
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34394933
remi2n 37705761
resetloop 174328
roundr_up_ip 518614140
setloop 2999293
shiftispec 713487906
sqrispec 1024893405
sqrispec_mirror 40097327
sqrtr_abs 126384799
sqrtremi 5159910
subiispec 3019246012
subiuspec 1780255925
truncr 3456113
umodiu 1329045010
xmpn_copy 6832560
xmpn_mirror 584701345
xmpn_mirrorcopy 714181266
xmpn_zero 237624378

Generated by: LCOV version 1.16