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

Generated by: LCOV version 1.16