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
addmulii 168690351
addmulii_gen 90756909
addmulii_inplace 1578260938
addmulii_lg3 472355237
affrr 1343936042
dblexpo 25895191
dblmantissa 0
dbltor 13385119
div0r 186655
divir 3502241
divrs 9871325
divru 1084163748
divsi 175
divsr 798
divur 2508481
int2n 106487430
int2u 26083238
int2um1 8831
invmod2BIL 60787933
invr 62869737
invr_basecase 62869329
mantissa_real 54196627
modii 3080098169
mul0r 482267
mulii 20946215264
mulir 988505008
mulrr 3958926127
mulrrz_3 652657829
mulrrz_3end 773254268
mulrrz_end 3557975449
mulrrz_i 3710695164
mulrrz_int 53801003
mulsi 612524803
mulsr 117489072
mulss 201179349
mului 1111768431
mulur 929146435
mulur_2 706514941
muluu 4561100941
rtodbl 288723397
shifti 2262014359
sqri 1900137853
sqrr 589231302
sqrs 732923
sqru 626918408
sqrz_i 556389325
truedvmdii 134196755
truedvmdis 131114992
truedvmdsi 6202031
trunc2nr 62680748
usqrt 231958779
vals 2277725468

Generated by: LCOV version 1.16