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

Generated by: LCOV version 1.16