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 30600-bbb75e9497) Lines: 535 567 94.4 %
Date: 2026-01-05 09:22:13 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 186655
mul0r 482308
sqrs 732697
divur 2508489
divir 3502241
truedvmdsi 6202031
divrs 9871282
dbltor 13384726
dblexpo 25892518
int2u 26083250
mulrrz_int 53801003
mantissa_real 54187624
invmod2BIL 60787934
trunc2nr 62677206
invr_basecase 62846749
invr 62846948
addmulii_gen 90728699
int2n 106480930
mulsr 117486612
truedvmdis 131092099
truedvmdii 134175427
addmulii 168720612
mulss 201178651
usqrt 231960743
rtodbl 288689514
addmulii_lg3 472356425
sqrz_i 556249575
sqrr 589159529
mulsi 612920692
sqru 626860717
mulrrz_3 652435462
mulur_2 706124908
mulrrz_3end 772952481
mulur 928685124
mulir 987935576
divru 1083974328
mului 1112407831
affrr 1343672121
addmulii_inplace 1578122721
sqri 1900170232
shifti 2261599890
vals 2277385537
modii 3080437538
mulrrz_end 3557579757
mulrrz_i 3708686532
mulrr 3957106453
muluu 4567298738
mulii 20965467240

Generated by: LCOV version 1.16