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 30674-be81ecfdd4) Lines: 683 719 95.0 %
Date: 2026-02-12 09:23:52 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 200528
muluui 222758
divis 323959
convi 439944
pari_gmp_free 1763110
setloop 2999302
truncr 3442860
sqrtremi 5128777
xmpn_copy 6836592
floorr 6940478
diviuexact 31785160
red_montgomery 34289873
divri_with_gmp 35479758
remi2n 38080298
sqrispec_mirror 40104296
icopy_ef 41521065
absdiviu_rem 51271685
mpz2GEN 57777217
divrr_with_gmp 76236742
muliispec_mirror 83416341
divis_rem 86352474
incpos 104206028
incloop 104596604
GEN2mpz 115552672
sqrtr_abs 126392738
mantissa2nr 138697882
divrr 142555251
divri 151792915
xmpn_zero 237939651
equaliispec 267752433
int_normalize 308774977
affir 405422529
diviuexact_i 413841706
roundr_up_ip 519396503
diviiexact 534724506
xmpn_mirror 586286108
shiftispec 714918646
xmpn_mirrorcopy 715481258
adduispec_offset 766703325
sqrispec 1024954906
umodiu 1330868756
subiuspec 1777443887
dvmdii 2195090654
adduispec 2791746321
subiispec 3015465644
addiispec 3332956349
cmpiispec 3974946838
muluispec 5599878884
muliispec 5829070698

Generated by: LCOV version 1.16