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 30672-116f3d5b0e) Lines: 535 567 94.4 %
Date: 2026-02-07 09:23:42 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168679913
addmulii_gen 90718752
addmulii_inplace 1578045190
addmulii_lg3 472319199
affrr 1344257810
dblexpo 25895459
dblmantissa 0
dbltor 13386070
div0r 186655
divir 3502245
divrs 9871422
divru 1084110007
divsi 175
divsr 798
divur 2508516
int2n 106486318
int2u 26083347
int2um1 8831
invmod2BIL 60786028
invr 62837804
invr_basecase 62837473
mantissa_real 54188469
modii 3082506964
mul0r 482263
mulii 20958026932
mulir 988915382
mulrr 3960909867
mulrrz_3 652790495
mulrrz_3end 773463188
mulrrz_end 3557713844
mulrrz_i 3711276691
mulrrz_int 53801019
mulsi 615496633
mulsr 117502564
mulss 201180122
mului 1115015103
mulur 929382099
mulur_2 706577811
muluu 4567852342
rtodbl 288691616
shifti 2262098080
sqri 1900675917
sqrr 589228456
sqrs 733698
sqru 627318869
sqrz_i 556371336
truedvmdii 134156262
truedvmdis 131075686
truedvmdsi 6202031
trunc2nr 62686088
usqrt 233890542
vals 2280222837

Generated by: LCOV version 1.16