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 30666-e2f9826198) Lines: 535 567 94.4 %
Date: 2026-02-04 09:22:32 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 186649
mul0r 482294
sqrs 732130
divur 2508504
divir 3502230
truedvmdsi 6202031
divrs 9871478
dbltor 13386196
dblexpo 25894145
int2u 26083592
mulrrz_int 53801019
mantissa_real 54191960
invmod2BIL 60785984
trunc2nr 62689777
invr_basecase 62855679
invr 62856324
addmulii_gen 90740514
int2n 106490839
mulsr 117496906
truedvmdis 131093626
truedvmdii 134173820
addmulii 168692219
mulss 201178694
usqrt 233857047
rtodbl 288699640
addmulii_lg3 472377980
sqrz_i 556406384
sqrr 589259118
mulsi 615535753
sqru 627278808
mulrrz_3 652902510
mulur_2 706358200
mulrrz_3end 773656246
mulur 929046525
mulir 988594204
divru 1083651336
mului 1112509082
affrr 1343902400
addmulii_inplace 1578338187
sqri 1901413748
shifti 2262628923
vals 2279474184
modii 3082272645
mulrrz_end 3557208244
mulrrz_i 3711377965
mulrr 3958315625
muluu 4564807906
mulii 20954845953

Generated by: LCOV version 1.16