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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 94.3 % 562 530
Test Date: 2026-09-26 17:04:41 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 191204524
addmulii_gen 99948003
addmulii_inplace 1633043447
addmulii_lg3 496965119
affrr 1422928874
dblexpo 27752031
dblmantissa 0
dbltor 13604702
div0r 0
divir 3278537
divrs 20390168
divru 1165698306
divsi 175
divsr 798
divur 2456246
int2n 111059833
int2u 25996876
int2um1 8807
invmod2BIL 61396731
invr 64290986
invr_basecase 64290986
mantissa_real 56112583
modii 3155445189
mul0r 481853
mulii 22013198186
mulir 1024559023
mulrr 4206210603
mulrrz_3 666779107
mulrrz_3end 789826111
mulrrz_end 3787018284
mulrrz_i 3957700764
mulrrz_int 54818665
mulsi 621543913
mulsr 132699078
mulss 201188880
mului 1168052848
mulur 970998934
mulur_2 757917128
muluu 4812035881
rtodbl 312603203
shifti 2325461579
sqri 1964259012
sqrr 602913851
sqrs 742871
sqru 648516087
sqrz_i 568905087
truedvmdii 143868564
truedvmdis 139275484
truedvmdsi 6202318
trunc2nr 62909258
usqrt 259084642
vals 2386825151

Generated by: LCOV version 2.0-1