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 30482-15ec328664) Lines: 683 719 95.0 %
Date: 2025-09-07 09:24:11 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115517368
absdiviu_rem 50855963
addiispec 3336561597
adduispec 2788658270
adduispec_offset 764691432
addumului 0
affir 404172231
cmpiispec 3979472249
convi 439354
diviiexact 533812653
divis 325469
divis_rem 86245275
diviuexact 31842396
diviuexact_i 413099193
diviuuexact 200490
divri 151454594
divri_with_gmp 35251660
divrr 142816510
divrr_with_gmp 76347966
dvmdii 2195761199
equaliispec 269631901
floorr 7134264
icopy_ef 41478216
incloop 103429193
incneg 66684
incpos 103027783
int_normalize 306427978
mantissa2nr 138408684
mpz2GEN 57759879
muliispec 5842426004
muliispec_mirror 85135090
muluispec 5600789097
muluui 222715
pari_gmp_free 1755948
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34988007
remi2n 39090200
resetloop 174328
roundr_up_ip 527507273
setloop 2999287
shiftispec 720056810
sqrispec 1031514618
sqrispec_mirror 41396302
sqrtr_abs 126567283
sqrtremi 5160767
subiispec 3022878570
subiuspec 1778686761
truncr 3645862
umodiu 1329154778
xmpn_copy 6896616
xmpn_mirror 587905900
xmpn_mirrorcopy 719634681
xmpn_zero 237925369

Generated by: LCOV version 1.16