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 30543-4febeb1110) Lines: 683 719 95.0 %
Date: 2025-11-10 09:22:37 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 1104
pari_kernel_init 1112
incneg 66684
resetloop 174328
diviuuexact 200473
muluui 222708
divis 325426
convi 439612
pari_gmp_free 1755951
setloop 2999290
truncr 3456624
sqrtremi 5161972
xmpn_copy 6897262
floorr 6945157
diviuexact 31841631
red_montgomery 35059432
divri_with_gmp 35251933
remi2n 39092001
sqrispec_mirror 40046957
icopy_ef 41490063
absdiviu_rem 51013443
mpz2GEN 57765157
divrr_with_gmp 76236546
muliispec_mirror 83261971
divis_rem 86249309
incpos 103189021
incloop 103596410
GEN2mpz 115527764
sqrtr_abs 126365228
mantissa2nr 138309211
divrr 142524820
divri 151469078
xmpn_zero 237572485
equaliispec 268850270
int_normalize 306704488
affir 404291801
diviuexact_i 413220612
roundr_up_ip 518445656
diviiexact 533910264
xmpn_mirror 584446827
xmpn_mirrorcopy 713879482
shiftispec 720194631
adduispec_offset 764432423
sqrispec 1030594120
umodiu 1329422456
subiuspec 1779132288
dvmdii 2197054068
adduispec 2788322977
subiispec 3023572309
addiispec 3336954930
cmpiispec 3979867207
muluispec 5601508793
muliispec 5841218767

Generated by: LCOV version 1.16