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

Generated by: LCOV version 1.16