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/none - mp_indep.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 94.3 % 562 530
Test Date: 2026-10-29 17:02:39 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 191219066
addmulii_gen 99953624
addmulii_inplace 1633024194
addmulii_lg3 496980923
affrr 1422931589
dblexpo 27752100
dblmantissa 0
dbltor 13604656
div0r 0
divir 3278537
divrs 20390162
divru 1165697730
divsi 175
divsr 798
divur 2456244
int2n 111061894
int2u 25996584
int2um1 8807
invmod2BIL 61396742
invr 64293207
invr_basecase 64293207
mantissa_real 56117658
modii 3155443906
mul0r 481872
mulii 22013634198
mulir 1024577036
mulrr 4206873139
mulrrz_3 666790446
mulrrz_3end 789839933
mulrrz_end 3787159209
mulrrz_i 3957847136
mulrrz_int 54818665
mulsi 621573626
mulsr 132697783
mulss 201188905
mului 1168116642
mulur 971016831
mulur_2 757929858
muluu 4812221770
rtodbl 312614372
shifti 2325518225
sqri 1964527002
sqrr 602928701
sqrs 742871
sqru 648517867
sqrz_i 568913462
truedvmdii 143891380
truedvmdis 139295870
truedvmdsi 6202318
trunc2nr 62909237
usqrt 258364724
vals 2386961003

Generated by: LCOV version 2.0-1