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 30674-be81ecfdd4) Lines: 535 567 94.4 %
Date: 2026-02-11 09:23:10 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 186656
mul0r 482300
sqrs 732866
divur 2508506
divir 3502241
truedvmdsi 6202031
divrs 9871479
dbltor 13385915
dblexpo 25899298
int2u 26083510
mulrrz_int 53801019
mantissa_real 54192501
invmod2BIL 60785986
trunc2nr 62690719
invr_basecase 62862844
invr 62863600
addmulii_gen 90741774
int2n 106492219
mulsr 117502159
truedvmdis 131107926
truedvmdii 134190723
addmulii 168691529
mulss 201179292
usqrt 234267063
rtodbl 288688115
addmulii_lg3 472374266
sqrz_i 556564606
sqrr 589347088
mulsi 615562205
sqru 627360696
mulrrz_3 653000026
mulur_2 706892023
mulrrz_3end 773741519
mulur 929761025
mulir 989245528
divru 1084569691
mului 1113756818
affrr 1344783120
addmulii_inplace 1578284325
sqri 1901657712
shifti 2262820969
vals 2280457977
modii 3083015212
mulrrz_end 3558169765
mulrrz_i 3712670084
mulrr 3960428668
muluu 4571144360
mulii 20966783568

Generated by: LCOV version 1.16