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 30571-c0dfe82732) Lines: 535 567 94.4 %
Date: 2025-12-10 09:22:03 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 187467
mul0r 482297
sqrs 732004
divur 2509422
divir 3503673
truedvmdsi 6202031
divrs 9872274
dbltor 13390603
dblexpo 25892731
int2u 26159303
mantissa_real 53762933
mulrrz_int 53801120
invmod2BIL 60843954
trunc2nr 62698945
invr_basecase 62862230
invr 62863348
addmulii_gen 90739084
int2n 106082793
mulsr 117519608
truedvmdis 131105815
truedvmdii 134192709
addmulii 168702205
mulss 201178576
usqrt 231451511
rtodbl 288922994
addmulii_lg3 472836868
sqrz_i 556333593
sqrr 589178222
mulsi 610728723
sqru 627062003
mulrrz_3 652737944
mulur_2 705729905
mulrrz_3end 773463013
mulur 928362462
mulir 987202947
divru 1083806227
mului 1108707872
affrr 1343545919
addmulii_inplace 1581469399
sqri 1911688561
vals 2268347391
shifti 2269887917
modii 3084038550
mulrrz_end 3557161264
mulrrz_i 3710595404
mulrr 3956724997
muluu 4568685020
mulii 20987957035

Generated by: LCOV version 1.16