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

Generated by: LCOV version 2.0-1