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

Generated by: LCOV version 2.0-1