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-12-03 17:02:49 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 481868
sqrs 742871
divur 2456241
divir 3278537
truedvmdsi 6202318
dbltor 13604208
divrs 20389964
int2u 25996758
dblexpo 27752121
mulrrz_int 54818641
mantissa_real 56114667
invmod2BIL 61396744
trunc2nr 62900285
invr 64290321
invr_basecase 64290321
addmulii_gen 99945819
int2n 111057058
mulsr 132688167
truedvmdis 139267212
truedvmdii 143861389
addmulii 191226096
mulss 201188863
usqrt 259172993
rtodbl 312605522
addmulii_lg3 497019373
sqrz_i 568891598
sqrr 602904150
mulsi 621557588
sqru 648480770
mulrrz_3 666705424
mulur_2 757926000
mulrrz_3end 789736687
mulur 971017801
mulir 1024571270
divru 1165697036
mului 1167913556
affrr 1422903642
addmulii_inplace 1633110029
sqri 1963590095
shifti 2325278837
vals 2386971735
modii 3154969894
mulrrz_end 3787037798
mulrrz_i 3957644347
mulrr 4206477747
muluu 4812264109
mulii 22013272002

Generated by: LCOV version 2.0-1