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

Generated by: LCOV version 1.16