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 30631-5f55634266) Lines: 535 567 94.4 %
Date: 2026-01-24 09:23:06 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 186655
mul0r 482267
sqrs 732923
divur 2508481
divir 3502241
truedvmdsi 6202031
divrs 9871325
dbltor 13385119
dblexpo 25895191
int2u 26083238
mulrrz_int 53801003
mantissa_real 54196627
invmod2BIL 60787933
trunc2nr 62680748
invr_basecase 62869329
invr 62869737
addmulii_gen 90756909
int2n 106487430
mulsr 117489072
truedvmdis 131114992
truedvmdii 134196755
addmulii 168690351
mulss 201179349
usqrt 231958779
rtodbl 288723397
addmulii_lg3 472355237
sqrz_i 556389325
sqrr 589231302
mulsi 612524803
sqru 626918408
mulrrz_3 652657829
mulur_2 706514941
mulrrz_3end 773254268
mulur 929146435
mulir 988505008
divru 1084163748
mului 1111768431
affrr 1343936042
addmulii_inplace 1578260938
sqri 1900137853
shifti 2262014359
vals 2277725468
modii 3080098169
mulrrz_end 3557975449
mulrrz_i 3710695164
mulrr 3958926127
muluu 4561100941
mulii 20946215264

Generated by: LCOV version 1.16