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-07 17:02:40 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 191215690
addmulii_gen 99945389
addmulii_inplace 1633082133
addmulii_lg3 497002191
affrr 1422905257
dblexpo 27752078
dblmantissa 0
dbltor 13604431
div0r 0
divir 3278537
divrs 20390034
divru 1165695165
divsi 175
divsr 798
divur 2456243
int2n 111057553
int2u 25996693
int2um1 8807
invmod2BIL 61396754
invr 64291334
invr_basecase 64291334
mantissa_real 56114608
modii 3155230058
mul0r 481861
mulii 22013526177
mulir 1024572844
mulrr 4206294642
mulrrz_3 666734426
mulrrz_3end 789769035
mulrrz_end 3787048086
mulrrz_i 3957683458
mulrrz_int 54818641
mulsi 621539353
mulsr 132692057
mulss 201188891
mului 1167993759
mulur 971016049
mulur_2 757928099
muluu 4812312145
rtodbl 312608810
shifti 2325387405
sqri 1964012397
sqrr 602906197
sqrs 742871
sqru 648492061
sqrz_i 568895123
truedvmdii 143867493
truedvmdis 139273672
truedvmdsi 6202318
trunc2nr 62904593
usqrt 258698183
vals 2386837402

Generated by: LCOV version 2.0-1