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-26 09:21:14 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 482286
sqrs 732046
divur 2508493
divir 3502247
truedvmdsi 6202031
divrs 9871258
dbltor 13383689
dblexpo 25890383
int2u 26082251
mantissa_real 53754110
mulrrz_int 53801066
invmod2BIL 60827488
trunc2nr 62674537
invr_basecase 62856808
invr 62857064
addmulii_gen 90742500
int2n 106042987
mulsr 117452502
truedvmdis 131085708
truedvmdii 134166630
addmulii 168693069
mulss 201177854
usqrt 231802827
rtodbl 288664588
addmulii_lg3 472791472
sqrz_i 556314240
sqrr 589142938
mulsi 610700400
sqru 626865699
mulrrz_3 652646798
mulur_2 705346311
mulrrz_3end 773272949
mulur 927912970
mulir 986750906
divru 1083863604
mului 1108423299
affrr 1343332124
addmulii_inplace 1581415374
sqri 1900652372
shifti 2259923168
vals 2275582997
modii 3080002734
mulrrz_end 3557326686
mulrrz_i 3709811230
mulrr 3956652645
muluu 4560708440
mulii 20965091660

Generated by: LCOV version 1.16