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 30640-c2c58e18c5) Lines: 535 567 94.4 %
Date: 2026-01-27 08:51:18 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 162842329
addmulii_gen 90443146
addmulii_inplace 1543510337
addmulii_lg3 447031042
affrr 1303920922
dblexpo 25638369
dblmantissa 0
dbltor 11716212
div0r 167718
divir 3453776
divrs 9502748
divru 1065490648
divsi 175
divsr 798
divur 2406063
int2n 96083193
int2u 24477285
int2um1 8762
invmod2BIL 60073956
invr 59549204
invr_basecase 59548370
mantissa_real 50437222
modii 2954972017
mul0r 387556
mulii 20525011745
mulir 949639914
mulrr 3698021062
mulrrz_3 589091615
mulrrz_3end 695418811
mulrrz_end 3358956226
mulrrz_i 3470607013
mulrrz_int 53633034
mulsi 603868596
mulsr 109921231
mulss 201163927
mului 1085719184
mulur 894665800
mulur_2 683373000
muluu 4462646345
rtodbl 267913058
shifti 2057115308
sqri 1853563745
sqrr 553434227
sqrs 732223
sqru 591423861
sqrz_i 522871649
truedvmdii 128530817
truedvmdis 126411668
truedvmdsi 6202031
trunc2nr 54609149
usqrt 228927988
vals 2257051368

Generated by: LCOV version 1.16