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 31080-f9bc4fce97) Lines: 94.3 % 562 530
Test Date: 2026-07-30 17:02:59 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8807
mul0r 481862
sqrs 742866
divur 2456234
divir 3278537
truedvmdsi 6202318
dbltor 13604114
divrs 20390014
int2u 25996479
dblexpo 27752138
mulrrz_int 54102156
mantissa_real 54677938
invmod2BIL 61410184
trunc2nr 62902761
invr 74758231
invr_basecase 74758231
addmulii_gen 93076558
int2n 109744194
mulsr 132692022
truedvmdis 139231926
truedvmdii 142578285
addmulii 169845177
mulss 201188947
usqrt 258687420
rtodbl 312592164
addmulii_lg3 483210825
sqrz_i 568775489
sqrr 602783550
mulsi 621351575
sqru 648217824
mulrrz_3 667112546
mulur_2 759194992
mulrrz_3end 790146087
mulur 974625342
mulir 1028185223
divru 1156632933
mului 1168127149
affrr 1424446434
addmulii_inplace 1633012366
sqri 1963885274
shifti 2328699542
vals 2384501279
modii 3155374470
mulrrz_end 3775309727
mulrrz_i 3946440941
mulrr 4194944064
muluu 4805700474
mulii 22004536814

Generated by: LCOV version 2.0-1