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 30608-ad1edb9ceb) Lines: 683 719 95.0 %
Date: 2026-01-13 09:22:00 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 200459
muluui 222688
divis 323931
convi 439788
pari_gmp_free 1762894
setloop 2999293
truncr 3456549
sqrtremi 5128728
xmpn_copy 6836323
floorr 6946060
diviuexact 31785454
red_montgomery 34363092
divri_with_gmp 35477504
remi2n 38035558
sqrispec_mirror 40096713
icopy_ef 41523180
absdiviu_rem 51265044
mpz2GEN 57774026
divrr_with_gmp 76243378
muliispec_mirror 83270368
divis_rem 86375552
incpos 103344312
incloop 103745749
GEN2mpz 115545770
sqrtr_abs 126376175
mantissa2nr 138654873
divrr 142531718
divri 151793204
xmpn_zero 237924820
equaliispec 267838238
int_normalize 308626340
affir 405167002
diviuexact_i 413533128
roundr_up_ip 518933832
diviiexact 534431945
xmpn_mirror 585591862
shiftispec 714006602
xmpn_mirrorcopy 715168588
adduispec_offset 765003402
sqrispec 1023817128
umodiu 1329336328
subiuspec 1778684604
dvmdii 2191839351
adduispec 2788104766
subiispec 3016939623
addiispec 3332340495
cmpiispec 3974480396
muluispec 5604696949
muliispec 5836724093

Generated by: LCOV version 1.16