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 30786-ffec283a2b) Lines: 535 567 94.4 %
Date: 2026-04-07 09:25:56 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 186614
mul0r 482276
sqrs 731695
divur 2524353
divir 3517219
truedvmdsi 6202087
divrs 9999020
dbltor 13463238
int2u 25349727
dblexpo 27265617
mulrrz_int 53799215
mantissa_real 54195700
invmod2BIL 60819566
trunc2nr 62824975
invr_basecase 65133817
invr 65134906
addmulii_gen 90674146
int2n 108505455
mulsr 120367300
truedvmdis 138811527
truedvmdii 141900288
addmulii 168735230
mulss 201177269
usqrt 251960501
rtodbl 295447077
addmulii_lg3 475475337
sqrz_i 561829040
sqrr 595314148
mulsi 617783557
sqru 639944786
mulrrz_3 658520435
mulur_2 722286057
mulrrz_3end 779420850
mulur 944794446
mulir 994333504
mului 1113502518
divru 1117354608
affrr 1378569805
addmulii_inplace 1617718289
sqri 2077816699
shifti 2286286551
vals 2316301405
modii 3124778483
mulrrz_end 3639056273
mulrrz_i 3792192272
mulrr 4038815678
muluu 4649639370
mulii 21153726188

Generated by: LCOV version 1.16