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 30835-e55edf4b45) Lines: 532 567 93.8 %
Date: 2026-04-25 09:26:46 Functions: 50 52 96.2 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8831
mul0r 481878
sqrs 732739
divur 2455668
divir 3261899
truedvmdsi 6202318
divrs 10001320
dbltor 13393862
int2u 25350859
dblexpo 27267125
mulrrz_int 53799439
mantissa_real 54192275
invmod2BIL 60813037
trunc2nr 62834175
invr_basecase 65170644
invr 65170954
addmulii_gen 90652713
int2n 108710612
mulsr 120389226
truedvmdis 138785430
truedvmdii 141871668
addmulii 168772377
mulss 201178266
usqrt 251718320
rtodbl 295545451
addmulii_lg3 475503914
sqrz_i 562109118
sqrr 595650490
mulsi 617760546
sqru 639682896
mulrrz_3 658663393
mulur_2 722150944
mulrrz_3end 779580636
mulur 944697748
mulir 994216928
mului 1110674748
divru 1117588862
affrr 1378658273
addmulii_inplace 1617672177
sqri 2078065957
shifti 2287213276
vals 2319140314
modii 3124152780
mulrrz_end 3640188865
mulrrz_i 3791861554
mulrr 4041163946
muluu 4651037503
mulii 21154822037

Generated by: LCOV version 1.16