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 30793-1ceee7ca5f) Lines: 535 567 94.4 %
Date: 2026-04-10 09:27:03 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
divsi 175
divsr 798
int2um1 8831
div0r 186607
mul0r 482294
sqrs 733163
divur 2524350
divir 3517216
truedvmdsi 6202087
divrs 9998974
dbltor 13463054
int2u 25350311
dblexpo 27264849
mulrrz_int 53799215
mantissa_real 54199293
invmod2BIL 60819578
trunc2nr 62829933
invr_basecase 65139044
invr 65139404
addmulii_gen 90677936
int2n 108509386
mulsr 120365380
truedvmdis 138837436
truedvmdii 141922311
addmulii 168727420
mulss 201178539
usqrt 250612744
rtodbl 295540886
addmulii_lg3 475487690
sqrz_i 561729971
sqrr 595366866
mulsi 617806421
sqru 640016375
mulrrz_3 658249328
mulur_2 722622356
mulrrz_3end 778911953
mulur 945131968
mulir 994737160
mului 1112420497
divru 1117503494
affrr 1378173399
addmulii_inplace 1617750469
sqri 2077126780
shifti 2286118930
vals 2316309661
modii 3122898122
mulrrz_end 3638984712
mulrrz_i 3789438381
mulrr 4039243709
muluu 4646982703
mulii 21146059145

Generated by: LCOV version 1.16