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

Generated by: LCOV version 1.16