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-12-02 17:03:19 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 191199812
addmulii_gen 99933396
addmulii_inplace 1633017318
addmulii_lg3 496976156
affrr 1422896045
dblexpo 27752009
dblmantissa 0
dbltor 13604251
div0r 0
divir 3278537
divrs 20390023
divru 1165688112
divsi 175
divsr 798
divur 2456240
int2n 111053079
int2u 25996264
int2um1 8807
invmod2BIL 61396754
invr 64288327
invr_basecase 64288327
mantissa_real 56107423
modii 3154820291
mul0r 481865
mulii 22012632358
mulir 1024548726
mulrr 4205925537
mulrrz_3 666719191
mulrrz_3end 789749704
mulrrz_end 3786818175
mulrrz_i 3957449510
mulrrz_int 54818641
mulsi 621521796
mulsr 132687651
mulss 201188897
mului 1167900043
mulur 970994104
mulur_2 757911212
muluu 4811970829
rtodbl 312593239
shifti 2325221552
sqri 1963580863
sqrr 602886341
sqrs 742871
sqru 648481498
sqrz_i 568879829
truedvmdii 143843775
truedvmdis 139252743
truedvmdsi 6202318
trunc2nr 62904025
usqrt 259390391
vals 2386796094

Generated by: LCOV version 2.0-1