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 30657-d14c2a9e4e) Lines: 535 567 94.4 %
Date: 2026-01-30 09:23:18 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 482283
sqrs 732826
divur 2508511
divir 3502236
truedvmdsi 6202031
divrs 9871364
dbltor 13385785
dblexpo 25898429
int2u 26083761
mulrrz_int 53801019
mantissa_real 54193446
invmod2BIL 60778035
trunc2nr 62684204
invr_basecase 62863162
invr 62863699
addmulii_gen 90752278
int2n 106483034
mulsr 117501295
truedvmdis 131102010
truedvmdii 134183464
addmulii 168688914
mulss 201179521
usqrt 232149591
rtodbl 288704354
addmulii_lg3 472345500
sqrz_i 556433570
sqrr 589269625
mulsi 612471480
sqru 626909129
mulrrz_3 652616780
mulur_2 706564636
mulrrz_3end 773191282
mulur 929366008
mulir 988715570
divru 1084569155
mului 1113324231
affrr 1344731029
addmulii_inplace 1578271829
sqri 1900822599
shifti 2262201525
vals 2278216047
modii 3082398177
mulrrz_end 3557832345
mulrrz_i 3711181412
mulrr 3958924262
muluu 4566915840
mulii 20955016246

Generated by: LCOV version 1.16