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-27 17:02:52 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8807
mul0r 481874
sqrs 742871
divur 2456241
divir 3278537
truedvmdsi 6202318
dbltor 13604396
divrs 20390097
int2u 25996713
dblexpo 27752011
mulrrz_int 54818641
mantissa_real 56112720
invmod2BIL 61396727
trunc2nr 62905649
invr 64290002
invr_basecase 64290002
addmulii_gen 99946871
int2n 111056561
mulsr 132691555
truedvmdis 139234394
truedvmdii 143828293
addmulii 191216916
mulss 201188922
usqrt 259086491
rtodbl 312606036
addmulii_lg3 497001123
sqrz_i 568894908
sqrr 602906400
mulsi 621513672
sqru 648480430
mulrrz_3 666743276
mulur_2 757920473
mulrrz_3end 789780949
mulur 971008969
mulir 1024565936
divru 1165694521
mului 1167989665
affrr 1422907123
addmulii_inplace 1633096827
sqri 1963944088
shifti 2325271529
vals 2387052268
modii 3154993595
mulrrz_end 3787049397
mulrrz_i 3957696898
mulrr 4206485688
muluu 4812003641
mulii 22013171051

Generated by: LCOV version 2.0-1