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 30480-572da319a6) Lines: 535 567 94.4 %
Date: 2025-08-26 09:23:46 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168634200
addmulii_gen 90722954
addmulii_inplace 1581209184
addmulii_lg3 472693773
affrr 1379004370
dblexpo 26463024
dblmantissa 0
dbltor 13386851
div0r 187460
divir 3501377
divrs 9865333
divru 1112886860
divsi 175
divsr 798
divur 2506946
int2n 105909584
int2u 26154299
int2um1 8831
invmod2BIL 60744260
invr 63098383
invr_basecase 63098112
mantissa_real 53597865
modii 3081718376
mul0r 482295
mulii 20970292221
mulir 987367835
mulrr 3996018110
mulrrz_3 654038794
mulrrz_3end 774503058
mulrrz_end 3599979327
mulrrz_i 3747616491
mulrrz_int 55660756
mulsi 609230720
mulsr 118139564
mulss 201178348
mului 1107334627
mulur 928467233
mulur_2 706523361
muluu 4561379724
rtodbl 289710102
shifti 2269405639
sqri 1911434351
sqrr 594045664
sqrs 732460
sqru 627153010
sqrz_i 561096852
truedvmdii 133934519
truedvmdis 130851362
truedvmdsi 6202031
trunc2nr 62693907
usqrt 231603484
vals 2266407181

Generated by: LCOV version 1.16