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 30831-19b50a36d0) Lines: 532 567 93.8 %
Date: 2026-04-20 09:27:00 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 481917
sqrs 732494
divur 2455665
divir 3261900
truedvmdsi 6202318
divrs 10001257
dbltor 13393777
int2u 25350414
dblexpo 27270048
mulrrz_int 53799439
mantissa_real 54194963
invmod2BIL 60812221
trunc2nr 62829588
invr_basecase 65192382
invr 65193442
addmulii_gen 90673330
int2n 108710422
mulsr 120372377
truedvmdis 138810414
truedvmdii 141896346
addmulii 168778189
mulss 201178164
usqrt 252705245
rtodbl 295509078
addmulii_lg3 475559584
sqrz_i 562196811
sqrr 595691074
mulsi 617806109
sqru 639676456
mulrrz_3 658769728
mulur_2 722449048
mulrrz_3end 779780637
mulur 945038511
mulir 994500486
mului 1113178264
divru 1117664458
affrr 1378750957
addmulii_inplace 1617953495
sqri 2077965105
shifti 2288015060
vals 2318528259
modii 3125396751
mulrrz_end 3639923090
mulrrz_i 3792933737
mulrr 4039800953
muluu 4655438248
mulii 21165460949

Generated by: LCOV version 1.16