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 30585-4c42182400) Lines: 535 567 94.4 %
Date: 2025-12-23 09:21:19 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 186653
mul0r 482288
sqrs 732315
divur 2508501
divir 3502239
truedvmdsi 6202031
divrs 9871360
dbltor 13383898
dblexpo 25892734
int2u 26072845
mantissa_real 53748470
mulrrz_int 53801066
invmod2BIL 60828589
trunc2nr 62677648
invr_basecase 62826163
invr 62826761
addmulii_gen 90701229
int2n 106039849
mulsr 117482795
truedvmdis 131057176
truedvmdii 134139692
addmulii 168683334
mulss 201178217
usqrt 231833281
rtodbl 288627966
addmulii_lg3 472749324
sqrz_i 556316602
sqrr 589159796
mulsi 610618956
sqru 626907945
mulrrz_3 652627801
mulur_2 705433052
mulrrz_3end 773244534
mulur 928031589
mulir 986804151
divru 1083953074
mului 1110157546
affrr 1343698977
addmulii_inplace 1581198178
sqri 1901005016
shifti 2259811541
vals 2274883048
modii 3080843200
mulrrz_end 3557225130
mulrrz_i 3709974051
mulrr 3958244001
muluu 4566202873
mulii 20971902548

Generated by: LCOV version 1.16