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

Generated by: LCOV version 1.16