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-08-16 17:03:01 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 191169131
addmulii_gen 99909210
addmulii_inplace 1632976340
addmulii_lg3 496943937
affrr 1422909875
dblexpo 27752055
dblmantissa 0
dbltor 13604448
div0r 0
divir 3278537
divrs 20390044
divru 1165693673
divsi 175
divsr 798
divur 2456243
int2n 111051360
int2u 25996818
int2um1 8807
invmod2BIL 61396755
invr 64291209
invr_basecase 64291209
mantissa_real 56104019
modii 3155630540
mul0r 481849
mulii 22012769792
mulir 1024522384
mulrr 4208138919
mulrrz_3 666779203
mulrrz_3end 789819460
mulrrz_end 3786825930
mulrrz_i 3957518214
mulrrz_int 54818641
mulsi 621475716
mulsr 132693384
mulss 201188879
mului 1168072042
mulur 970968393
mulur_2 757889677
muluu 4811853246
rtodbl 312576677
shifti 2325468103
sqri 1964294408
sqrr 602917107
sqrs 742871
sqru 648490124
sqrz_i 568888636
truedvmdii 143824326
truedvmdis 139236783
truedvmdsi 6202318
trunc2nr 62904212
usqrt 258202602
vals 2386694804

Generated by: LCOV version 2.0-1