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-09-06 17:02:10 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8807
mul0r 481847
sqrs 742871
divur 2456244
divir 3278537
truedvmdsi 6202318
dbltor 13604508
divrs 20390080
int2u 25996682
dblexpo 27752130
mulrrz_int 54818641
mantissa_real 56112750
invmod2BIL 61396739
trunc2nr 62904477
invr 64292153
invr_basecase 64292153
addmulii_gen 99934182
int2n 111056435
mulsr 132692171
truedvmdis 139286374
truedvmdii 143879474
addmulii 191208760
mulss 201188912
usqrt 258537581
rtodbl 312605305
addmulii_lg3 496999540
sqrz_i 568896643
sqrr 602910200
mulsi 621537603
sqru 648496184
mulrrz_3 666743218
mulur_2 757924174
mulrrz_3end 789780303
mulur 971016137
mulir 1024571027
divru 1165702668
mului 1168138426
affrr 1422918493
addmulii_inplace 1633089682
sqri 1964605314
shifti 2325519693
vals 2386855714
modii 3155517958
mulrrz_end 3786954014
mulrrz_i 3957599134
mulrr 4206471648
muluu 4812228255
mulii 22013466752

Generated by: LCOV version 2.0-1