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 30851-7844d7b3a5) Lines: 532 567 93.8 %
Date: 2026-05-02 09:26:58 Functions: 50 52 96.2 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8831
mul0r 481908
sqrs 732753
divur 2455695
divir 3261901
truedvmdsi 6202318
divrs 10001301
dbltor 13393847
int2u 25350697
dblexpo 27265248
mulrrz_int 53799439
mantissa_real 54193486
invmod2BIL 60849993
trunc2nr 62831095
invr_basecase 65173190
invr 65173342
addmulii_gen 90651399
int2n 108746487
mulsr 120373485
truedvmdis 138782197
truedvmdii 141869101
addmulii 168808873
mulss 201178117
usqrt 251211977
rtodbl 295504496
addmulii_lg3 475555265
sqrz_i 562073304
sqrr 595619973
mulsi 617777602
sqru 639725256
mulrrz_3 658692770
mulur_2 722289397
mulrrz_3end 779614518
mulur 944885806
mulir 994473307
mului 1113944627
divru 1117428061
affrr 1378433065
addmulii_inplace 1617754343
sqri 2078215711
shifti 2287438123
vals 2319677437
modii 3124807830
mulrrz_end 3640110611
mulrrz_i 3792022956
mulrr 4040705176
muluu 4648901292
mulii 21152177178

Generated by: LCOV version 1.16