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 30754-316d984fc8) Lines: 535 567 94.4 %
Date: 2026-03-19 09:26:57 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 186613
mul0r 482296
sqrs 735177
divur 2524360
divir 3517571
truedvmdsi 6202031
divrs 9998015
dbltor 13463668
int2u 25350768
dblexpo 27269125
mulrrz_int 53799215
mantissa_real 54192985
invmod2BIL 60819539
trunc2nr 62833562
invr_basecase 65111464
invr 65111700
addmulii_gen 90650318
int2n 106539849
mulsr 120368239
truedvmdis 138820230
truedvmdii 141902874
addmulii 168746369
mulss 201181485
usqrt 253056755
rtodbl 295537457
addmulii_lg3 475523520
sqrz_i 562003456
sqrr 595484650
mulsi 617773632
sqru 640738098
mulrrz_3 658696372
mulur_2 723299022
mulrrz_3end 779598141
mulur 945840948
mulir 995604931
mului 1117187250
divru 1117771333
affrr 1379359966
addmulii_inplace 1617838026
sqri 2079582446
shifti 2288922430
vals 2317778936
modii 3122042680
mulrrz_end 3639213628
mulrrz_i 3792105174
mulrr 4042335268
muluu 4660952172
mulii 21176510264

Generated by: LCOV version 1.16