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 30586-ccf601f509) Lines: 684 719 95.1 %
Date: 2025-12-25 09:21:36 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115605598
absdiviu_rem 51096023
addiispec 3335113158
adduispec 2789754491
adduispec_offset 764724155
addumului 0
affir 404497488
cmpiispec 3976924583
convi 439781
diviiexact 534134121
divis 323933
divis_rem 86372222
diviuexact 31786668
diviuexact_i 413224600
diviuuexact 200447
divri 151540982
divri_with_gmp 35251270
divrr 142564294
divrr_with_gmp 76258450
dvmdii 2193260446
equaliispec 268815096
floorr 6948588
icopy_ef 41495842
incloop 103840525
incneg 66684
incpos 103434643
int_normalize 308935925
mantissa2nr 138415871
mpz2GEN 57803961
muliispec 5840377115
muliispec_mirror 83315044
muluispec 5607755303
muluui 222695
pari_gmp_free 1735790
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34459430
remi2n 37717338
resetloop 174328
roundr_up_ip 518776081
setloop 2999295
shiftispec 713785780
sqrispec 1025432671
sqrispec_mirror 40101706
sqrtr_abs 126391469
sqrtremi 5159884
subiispec 3020052405
subiuspec 1780311180
truncr 3461462
umodiu 1329686887
xmpn_copy 6832785
xmpn_mirror 584885877
xmpn_mirrorcopy 714365255
xmpn_zero 237656694

Generated by: LCOV version 1.16