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) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 94.3 % 562 530
Test Date: 2026-07-23 17:04:59 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8807
mul0r 481871
sqrs 742866
divur 2456239
divir 3278537
truedvmdsi 6202318
dbltor 13603453
divrs 20390035
int2u 25996753
dblexpo 27752165
mulrrz_int 54102158
mantissa_real 54676931
invmod2BIL 61358106
trunc2nr 62903004
invr 74743843
invr_basecase 74743843
addmulii_gen 92949740
int2n 109733767
mulsr 132688715
truedvmdis 139105733
truedvmdii 142365386
addmulii 169826513
mulss 201188881
usqrt 258620549
rtodbl 312324895
addmulii_lg3 482952673
sqrz_i 568767212
sqrr 602794940
mulsi 621291120
sqru 648177240
mulrrz_3 667156669
mulur_2 759151313
mulrrz_3end 790185232
mulur 974583016
mulir 1028139018
divru 1156631929
mului 1167452871
affrr 1424430326
addmulii_inplace 1631435363
sqri 1963819188
shifti 2323477028
vals 2384407099
modii 3154928971
mulrrz_end 3775528395
mulrrz_i 3946707031
mulrr 4197556848
muluu 4809824724
mulii 21995601330

Generated by: LCOV version 2.0-1