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

Generated by: LCOV version 2.0-1