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 30608-ad1edb9ceb) Lines: 535 567 94.4 %
Date: 2026-01-13 09:22:00 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168697015
addmulii_gen 90737906
addmulii_inplace 1578240807
addmulii_lg3 472348963
affrr 1343611591
dblexpo 25892189
dblmantissa 0
dbltor 13385086
div0r 186650
divir 3502235
divrs 9871257
divru 1083614072
divsi 175
divsr 798
divur 2508494
int2n 106480195
int2u 26082959
int2um1 8831
invmod2BIL 60787943
invr 62858470
invr_basecase 62858023
mantissa_real 54191960
modii 3079653993
mul0r 482287
mulii 20967719603
mulir 988107401
mulrr 3957723234
mulrrz_3 652541713
mulrrz_3end 773096648
mulrrz_end 3557756031
mulrrz_i 3710068118
mulrrz_int 53801003
mulsi 612484533
mulsr 117484738
mulss 201176456
mului 1111941853
mulur 928753505
mulur_2 706077025
muluu 4566053586
rtodbl 288684153
shifti 2261740605
sqri 1900052189
sqrr 589190229
sqrs 731316
sqru 626832449
sqrz_i 556301038
truedvmdii 134184800
truedvmdis 131102764
truedvmdsi 6202031
trunc2nr 62678324
usqrt 231824870
vals 2276705945

Generated by: LCOV version 1.16