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 30571-c0dfe82732) Lines: 535 567 94.4 %
Date: 2025-12-06 09:22:10 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 187464
mul0r 482304
sqrs 731629
divur 2509417
divir 3503667
truedvmdsi 6202031
divrs 9872174
dbltor 13390194
dblexpo 25892392
int2u 26159228
mantissa_real 53760587
mulrrz_int 53801120
invmod2BIL 60843942
trunc2nr 62693646
invr_basecase 62854994
invr 62856067
addmulii_gen 90739927
int2n 106080120
mulsr 117524429
truedvmdis 131090532
truedvmdii 134176349
addmulii 168691963
mulss 201178233
usqrt 231597276
rtodbl 288972153
addmulii_lg3 472800460
sqrz_i 556273707
sqrr 589140609
mulsi 610683162
sqru 627040893
mulrrz_3 652576375
mulur_2 705516019
mulrrz_3end 773239210
mulur 928126373
mulir 986855100
divru 1083789842
mului 1109452590
affrr 1343435652
addmulii_inplace 1581429525
sqri 1911878904
vals 2268137311
shifti 2269764282
modii 3083973206
mulrrz_end 3556920006
mulrrz_i 3710120755
mulrr 3956087767
muluu 4567657717
mulii 20987162884

Generated by: LCOV version 1.16