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 30835-e55edf4b45) Lines: 532 567 93.8 %
Date: 2026-04-24 09:27:20 Functions: 50 52 96.2 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168770508
addmulii_gen 90652366
addmulii_inplace 1617706190
addmulii_lg3 475530158
affrr 1378493929
dblexpo 27266609
dblmantissa 0
dbltor 13393630
div0r 0
divir 3261897
divrs 10001312
divru 1117509414
divsi 175
divsr 798
divur 2455673
int2n 108709067
int2u 25350370
int2um1 8831
invmod2BIL 60812214
invr 65177587
invr_basecase 65177371
mantissa_real 54194462
modii 3124081772
mul0r 481908
mulii 21154337836
mulir 994301047
mulrr 4041363037
mulrrz_3 658695708
mulrrz_3end 779648609
mulrrz_end 3640264083
mulrrz_i 3791991750
mulrrz_int 53799439
mulsi 617761943
mulsr 120364958
mulss 201178106
mului 1111848646
mulur 944731714
mulur_2 722201635
muluu 4649831911
rtodbl 295499904
shifti 2287433082
sqri 2078219947
sqrr 595647003
sqrs 732588
sqru 639665569
sqrz_i 562098913
truedvmdii 141881701
truedvmdis 138795150
truedvmdsi 6202318
trunc2nr 62833002
usqrt 251200668
vals 2318667998

Generated by: LCOV version 1.16