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.19.0 lcov report (development 31092-e6893b0017) Lines: 94.3 % 562 530
Test Date: 2026-10-17 17:03:22 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 191181899
addmulii_gen 99908326
addmulii_inplace 1633033639
addmulii_lg3 496964647
affrr 1422916510
dblexpo 27752116
dblmantissa 0
dbltor 13604613
div0r 0
divir 3278537
divrs 20390070
divru 1165697964
divsi 175
divsr 798
divur 2456244
int2n 111052686
int2u 25996987
int2um1 8807
invmod2BIL 61396756
invr 64291967
invr_basecase 64291967
mantissa_real 56106267
modii 3155969364
mul0r 481872
mulii 22012935915
mulir 1024545385
mulrr 4208567493
mulrrz_3 666748559
mulrrz_3end 789785967
mulrrz_end 3786899795
mulrrz_i 3957554223
mulrrz_int 54818641
mulsi 621493138
mulsr 132690856
mulss 201188898
mului 1168167819
mulur 970993136
mulur_2 757907025
muluu 4811800924
rtodbl 312579292
shifti 2325629821
sqri 1964676584
sqrr 602925806
sqrs 742871
sqru 648496475
sqrz_i 568892999
truedvmdii 143829676
truedvmdis 139240641
truedvmdsi 6202318
trunc2nr 62903882
usqrt 258835242
vals 2386984232

Generated by: LCOV version 2.0-1