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 30586-ccf601f509) Lines: 535 567 94.4 %
Date: 2025-12-25 09:21:36 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 482290
sqrs 732584
divur 2508500
divir 3502240
truedvmdsi 6202031
divrs 9871259
dbltor 13383895
dblexpo 25894062
int2u 26081896
mantissa_real 53755183
mulrrz_int 53801066
invmod2BIL 60827530
trunc2nr 62674892
invr_basecase 62859003
invr 62859379
addmulii_gen 90750857
int2n 106040242
mulsr 117483585
truedvmdis 131090512
truedvmdii 134173695
addmulii 168685821
mulss 201178708
usqrt 231418011
rtodbl 288690813
addmulii_lg3 472778221
sqrz_i 556404812
sqrr 589210795
mulsi 610720422
sqru 626939955
mulrrz_3 652704355
mulur_2 705555793
mulrrz_3end 773347841
mulur 928190739
mulir 986993806
divru 1084135645
mului 1110499304
affrr 1344004520
addmulii_inplace 1581459041
sqri 1901625011
shifti 2260334013
vals 2275818010
modii 3082098363
mulrrz_end 3557663224
mulrrz_i 3710955841
mulrr 3957576216
muluu 4569992643
mulii 20978337153

Generated by: LCOV version 1.16