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 30572-91e0396466) Lines: 535 567 94.4 %
Date: 2025-12-12 09:22:23 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 187467
mul0r 482320
sqrs 731687
divur 2509418
divir 3503673
truedvmdsi 6202031
divrs 9872264
dbltor 13390442
dblexpo 25893492
int2u 26159198
mantissa_real 53764714
mulrrz_int 53801120
invmod2BIL 60843957
trunc2nr 62695284
invr_basecase 62868237
invr 62869320
addmulii_gen 90752828
int2n 106081137
mulsr 117517549
truedvmdis 131108684
truedvmdii 134194951
addmulii 168692799
mulss 201178319
usqrt 231772309
rtodbl 288959436
addmulii_lg3 472793915
sqrz_i 556328919
sqrr 589189639
mulsi 610718582
sqru 627029592
mulrrz_3 652601030
mulur_2 705530175
mulrrz_3end 773281339
mulur 928201854
mulir 986956941
divru 1083886394
mului 1108482777
affrr 1343655555
addmulii_inplace 1581435898
sqri 1911839683
vals 2267952738
shifti 2269656231
modii 3083663825
mulrrz_end 3557314851
mulrrz_i 3710464476
mulrr 3956947560
muluu 4568467784
mulii 20987107871

Generated by: LCOV version 1.16