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 30734-f1f26dedcb) Lines: 535 567 94.4 %
Date: 2026-03-07 09:24:37 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 186609
mul0r 482264
sqrs 734959
divur 2508884
divir 3502437
truedvmdsi 6202031
divrs 9872748
dbltor 13444039
int2u 25348224
dblexpo 25898501
mulrrz_int 53799215
mantissa_real 54195436
invmod2BIL 60801895
trunc2nr 62724663
invr_basecase 62841036
invr 62841561
addmulii_gen 90674340
int2n 106457170
mulsr 117535044
truedvmdis 138787032
truedvmdii 141870087
addmulii 168735480
mulss 201182212
usqrt 252948130
rtodbl 288877209
addmulii_lg3 475514014
sqrz_i 556569082
sqrr 589368684
mulsi 617501139
sqru 635675037
mulrrz_3 652968943
mulur_2 716516687
mulrrz_3end 773645961
mulur 939308565
mulir 989167070
divru 1094198244
mului 1116249646
affrr 1344966865
addmulii_inplace 1617950514
sqri 2061902218
shifti 2278680980
vals 2314031251
modii 3088756197
mulrrz_end 3558251129
mulrrz_i 3712449398
mulrr 3958577065
muluu 4656922126
mulii 21140387031

Generated by: LCOV version 1.16