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 30574-595e4ba651) Lines: 535 567 94.4 %
Date: 2025-12-17 09:21:45 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168708636
addmulii_gen 90748880
addmulii_inplace 1581501268
addmulii_lg3 472866678
affrr 1343719871
dblexpo 25895977
dblmantissa 0
dbltor 13390428
div0r 187463
divir 3503673
divrs 9872249
divru 1083901398
divsi 175
divsr 798
divur 2509420
int2n 106083665
int2u 26159269
int2um1 8831
invmod2BIL 60843935
invr 62873025
invr_basecase 62871959
mantissa_real 53766966
modii 3084131918
mul0r 482295
mulii 20989663157
mulir 987185217
mulrr 3957345805
mulrrz_3 652711075
mulrrz_3end 773413466
mulrrz_end 3557388749
mulrrz_i 3711052467
mulrrz_int 53801120
mulsi 610738641
mulsr 117501146
mulss 201178073
mului 1108110221
mulur 928363608
mulur_2 705704465
muluu 4568710183
rtodbl 288971157
shifti 2269991086
sqri 1912338463
sqrr 589257660
sqrs 731488
sqru 627053312
sqrz_i 556436967
truedvmdii 134205121
truedvmdis 131118323
truedvmdsi 6202031
trunc2nr 62697083
usqrt 231654912
vals 2267719795

Generated by: LCOV version 1.16