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 30735-65f72320ad) Lines: 535 567 94.4 %
Date: 2026-03-13 09:24:04 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 186614
mul0r 482283
sqrs 733121
divur 2508887
divir 3502456
truedvmdsi 6202031
divrs 9872820
dbltor 13444412
int2u 25348164
dblexpo 25894136
mulrrz_int 53799239
mantissa_real 54196432
invmod2BIL 60801846
trunc2nr 62729892
invr_basecase 62844214
invr 62844822
addmulii_gen 90674155
int2n 106473649
mulsr 117531383
truedvmdis 138778420
truedvmdii 141863753
addmulii 168729302
mulss 201179258
usqrt 253048310
rtodbl 288866550
addmulii_lg3 475512234
sqrz_i 556469617
sqrr 589275593
mulsi 617506647
sqru 635664248
mulrrz_3 653095836
mulur_2 716208488
mulrrz_3end 773877163
mulur 938934974
mulir 988891151
divru 1093262196
mului 1115526229
affrr 1344013846
addmulii_inplace 1618035304
sqri 2061258407
shifti 2278496255
vals 2313426826
modii 3090071996
mulrrz_end 3557676247
mulrrz_i 3712436629
mulrr 3957719986
muluu 4652243801
mulii 21136027455

Generated by: LCOV version 1.16