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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30674-be81ecfdd4) Lines: 535 567 94.4 %
Date: 2026-02-13 09:23:38 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
divsi 175
divsr 798
int2um1 8831
div0r 186656
mul0r 482283
sqrs 735575
divur 2508510
divir 3502247
truedvmdsi 6202031
divrs 9871425
dbltor 13385995
dblexpo 25898077
int2u 26083421
mulrrz_int 53801043
mantissa_real 54193116
invmod2BIL 60786032
trunc2nr 62687008
invr_basecase 62862478
invr 62863078
addmulii_gen 90751622
int2n 106490396
mulsr 117507664
truedvmdis 131124004
truedvmdii 134204529
addmulii 168689724
mulss 201182214
usqrt 234220034
rtodbl 288695124
addmulii_lg3 472333135
sqrz_i 556519372
sqrr 589331356
mulsi 615577934
sqru 627361257
mulrrz_3 652918610
mulur_2 706933876
mulrrz_3end 773631426
mulur 929706667
mulir 989207526
divru 1084510232
mului 1114170380
affrr 1344686013
addmulii_inplace 1578266470
sqri 1901851261
shifti 2262912505
vals 2280459359
modii 3083782738
mulrrz_end 3558013566
mulrrz_i 3712274017
mulrr 3959704369
muluu 4570517535
mulii 20964139421

Generated by: LCOV version 1.16