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 30589-01bb95f8b7) Lines: 683 719 95.0 %
Date: 2025-12-30 09:21:31 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115603858
absdiviu_rem 51096702
addiispec 3334417706
adduispec 2789987124
adduispec_offset 764611811
addumului 0
affir 404450863
cmpiispec 3976022644
convi 439771
diviiexact 534027110
divis 323942
divis_rem 86375441
diviuexact 31785801
diviuexact_i 413114344
diviuuexact 200500
divri 151541361
divri_with_gmp 35251063
divrr 142557186
divrr_with_gmp 76254768
dvmdii 2192836541
equaliispec 268814870
floorr 6947737
icopy_ef 41496185
incloop 103972578
incneg 66684
incpos 103562830
int_normalize 309134927
mantissa2nr 138414139
mpz2GEN 57803241
muliispec 5838379825
muliispec_mirror 83300447
muluispec 5606002431
muluui 222744
pari_gmp_free 1735791
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34425874
remi2n 37696920
resetloop 174328
roundr_up_ip 518679953
setloop 2999291
shiftispec 713452572
sqrispec 1024795237
sqrispec_mirror 40097892
sqrtr_abs 126390903
sqrtremi 5159879
subiispec 3019254167
subiuspec 1780118818
truncr 3461106
umodiu 1330368105
xmpn_copy 6832537
xmpn_mirror 584866996
xmpn_mirrorcopy 714319601
xmpn_zero 237643794

Generated by: LCOV version 1.16