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

Generated by: LCOV version 1.16