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

Generated by: LCOV version 1.16