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 30660-09c6d0ed2e) Lines: 535 567 94.4 %
Date: 2026-02-03 09:23:21 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 186656
mul0r 482284
sqrs 732170
divur 2508505
divir 3502243
truedvmdsi 6202031
divrs 9871382
dbltor 13385799
dblexpo 25896972
int2u 26083547
mulrrz_int 53801019
mantissa_real 54194168
invmod2BIL 60778053
trunc2nr 62683214
invr_basecase 62866976
invr 62867577
addmulii_gen 90740931
int2n 106488214
mulsr 117500993
truedvmdis 131110561
truedvmdii 134190193
addmulii 168689080
mulss 201178817
usqrt 231854256
rtodbl 288683971
addmulii_lg3 472360233
sqrz_i 556433626
sqrr 589281674
mulsi 612484027
sqru 626935118
mulrrz_3 652725857
mulur_2 706538444
mulrrz_3end 773349082
mulur 929273494
mulir 988610242
divru 1084407299
mului 1112581377
affrr 1344415970
addmulii_inplace 1578218831
sqri 1900776623
shifti 2262403268
vals 2277907000
modii 3082029927
mulrrz_end 3557683261
mulrrz_i 3711167414
mulrr 3959451460
muluu 4565358762
mulii 20953614729

Generated by: LCOV version 1.16