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 30603-c72b2decfc) Lines: 535 567 94.4 %
Date: 2026-01-07 09:21:48 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 186656
mul0r 482291
sqrs 732165
divur 2508492
divir 3502239
truedvmdsi 6202031
divrs 9871336
dbltor 13384871
dblexpo 25892853
int2u 26083547
mulrrz_int 53801003
mantissa_real 54188807
invmod2BIL 60787953
trunc2nr 62677594
invr_basecase 62852733
invr 62853254
addmulii_gen 90737843
int2n 106482051
mulsr 117483850
truedvmdis 131085733
truedvmdii 134169688
addmulii 168681912
mulss 201178375
usqrt 231920495
rtodbl 288682419
addmulii_lg3 472298347
sqrz_i 556268235
sqrr 589184680
mulsi 612439447
sqru 626826113
mulrrz_3 652476366
mulur_2 705867691
mulrrz_3end 773015393
mulur 928467381
mulir 987827733
divru 1083734068
mului 1112086180
affrr 1343685964
addmulii_inplace 1578154849
sqri 1900426184
shifti 2261729304
vals 2276648699
modii 3080074080
mulrrz_end 3557701337
mulrrz_i 3709893966
mulrr 3957375452
muluu 4565901652
mulii 20965782326

Generated by: LCOV version 1.16