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 30674-be81ecfdd4) Lines: 535 567 94.4 %
Date: 2026-02-12 09:23:52 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168681024
addmulii_gen 90721050
addmulii_inplace 1578242525
addmulii_lg3 472339023
affrr 1344358290
dblexpo 25894809
dblmantissa 0
dbltor 13386210
div0r 186649
divir 3502234
divrs 9871539
divru 1084258332
divsi 175
divsr 798
divur 2508513
int2n 106493798
int2u 26083682
int2um1 8831
invmod2BIL 60785985
invr 62841085
invr_basecase 62839982
mantissa_real 54189123
modii 3082941853
mul0r 482294
mulii 20958239852
mulir 988619363
mulrr 3961917190
mulrrz_3 653111731
mulrrz_3end 773938402
mulrrz_end 3557826015
mulrrz_i 3712519629
mulrrz_int 53801043
mulsi 615477338
mulsr 117495103
mulss 201178981
mului 1113623564
mulur 929216405
mulur_2 706495378
muluu 4565000182
rtodbl 288681009
shifti 2262958729
sqri 1901180888
sqrr 589317002
sqrs 732645
sqru 627364828
sqrz_i 556517485
truedvmdii 134159173
truedvmdis 131080371
truedvmdsi 6202031
trunc2nr 62695148
usqrt 234159364
vals 2279993524

Generated by: LCOV version 1.16