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 30616-7aa4fb0184) Lines: 535 567 94.4 %
Date: 2026-01-17 09:22:32 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168696726
addmulii_gen 90724139
addmulii_inplace 1578023848
addmulii_lg3 472283254
affrr 1343503851
dblexpo 25890709
dblmantissa 0
dbltor 13384790
div0r 186656
divir 3502239
divrs 9871312
divru 1083893881
divsi 175
divsr 798
divur 2508485
int2n 106476190
int2u 26082623
int2um1 8831
invmod2BIL 60787967
invr 62839908
invr_basecase 62839568
mantissa_real 54188978
modii 3079731087
mul0r 482294
mulii 20961094909
mulir 987121983
mulrr 3959020809
mulrrz_3 652512543
mulrrz_3end 773101297
mulrrz_end 3557983832
mulrrz_i 3710817703
mulrrz_int 53801003
mulsi 612426967
mulsr 117489322
mulss 201177305
mului 1111767212
mulur 928017511
mulur_2 705472848
muluu 4563568857
rtodbl 288571725
shifti 2261135893
sqri 1900715264
sqrr 589072625
sqrs 731714
sqru 626752605
sqrz_i 556223481
truedvmdii 134155468
truedvmdis 131070309
truedvmdsi 6202031
trunc2nr 62670863
usqrt 231687600
vals 2276909057

Generated by: LCOV version 1.16