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 30673-b6380924e9) Lines: 535 567 94.4 %
Date: 2026-02-08 09:23:25 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168684261
addmulii_gen 90758625
addmulii_inplace 1578256258
addmulii_lg3 472351477
affrr 1344440747
dblexpo 25898167
dblmantissa 0
dbltor 13386031
div0r 186652
divir 3502235
divrs 9871460
divru 1084374898
divsi 175
divsr 798
divur 2508512
int2n 106492294
int2u 26083583
int2um1 8831
invmod2BIL 60786042
invr 62872328
invr_basecase 62871806
mantissa_real 54197628
modii 3082641881
mul0r 482276
mulii 20961503185
mulir 988901404
mulrr 3959643450
mulrrz_3 652739104
mulrrz_3end 773382330
mulrrz_end 3557997305
mulrrz_i 3711587155
mulrrz_int 53801019
mulsi 615575519
mulsr 117498101
mulss 201182151
mului 1114443596
mulur 929487831
mulur_2 706675603
muluu 4570435332
rtodbl 288732412
shifti 2262440662
sqri 1900970509
sqrr 589288835
sqrs 732399
sqru 627349986
sqrz_i 556473409
truedvmdii 134188769
truedvmdis 131109074
truedvmdsi 6202031
trunc2nr 62686239
usqrt 234227999
vals 2280398347

Generated by: LCOV version 1.16