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 30547-1b347192b6) Lines: 535 567 94.4 %
Date: 2025-11-12 09:22:59 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 187461
mul0r 482278
sqrs 731510
divur 2509307
divir 3503628
truedvmdsi 6202031
divrs 9871132
dbltor 13389097
dblexpo 25891060
int2u 26155868
mantissa_real 53606821
mulrrz_int 53800594
invmod2BIL 60744901
trunc2nr 62694520
invr_basecase 62824705
invr 62825325
addmulii_gen 90708004
int2n 105933879
mulsr 117497481
truedvmdis 130852805
truedvmdii 133932293
addmulii 168637708
mulss 201177574
usqrt 231781803
rtodbl 288896820
addmulii_lg3 472660500
sqrz_i 555658810
sqrr 588532039
mulsi 609224834
sqru 626942169
mulrrz_3 652651000
mulur_2 704503241
mulrrz_3end 773271469
mulur 927069247
mulir 985755139
divru 1083731934
mului 1108339322
affrr 1343324091
addmulii_inplace 1581130990
sqri 1912037372
vals 2266913392
shifti 2269314391
modii 3083562912
mulrrz_end 3555656065
mulrrz_i 3709505334
mulrr 3958041963
muluu 4563533752
mulii 20974300211

Generated by: LCOV version 1.16