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 30824-18397de1d0) Lines: 532 567 93.8 %
Date: 2026-04-18 09:26:04 Functions: 50 52 96.2 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8831
mul0r 481908
sqrs 731705
divur 2455677
divir 3261896
truedvmdsi 6202318
divrs 10001247
dbltor 13393778
int2u 25350685
dblexpo 27267433
mulrrz_int 53799439
mantissa_real 54196140
invmod2BIL 60812207
trunc2nr 62828439
invr_basecase 65195623
invr 65196488
addmulii_gen 90673062
int2n 108710729
mulsr 120385073
truedvmdis 138827063
truedvmdii 141917243
addmulii 168772488
mulss 201177381
usqrt 252104388
rtodbl 295525651
addmulii_lg3 475539043
sqrz_i 562105026
sqrr 595598815
mulsi 617817276
sqru 639648720
mulrrz_3 658770276
mulur_2 722314163
mulrrz_3end 779776637
mulur 944893954
mulir 994386402
mului 1112283314
divru 1117466703
affrr 1378557783
addmulii_inplace 1617850600
sqri 2077504087
shifti 2287534488
vals 2318348336
modii 3124315645
mulrrz_end 3639835003
mulrrz_i 3792859754
mulrr 4039453058
muluu 4651026573
mulii 21157422588

Generated by: LCOV version 1.16