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 30764-6b81f1f3fa) Lines: 535 567 94.4 %
Date: 2026-03-25 09:26:52 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 186614
mul0r 482302
sqrs 737093
divur 2524361
divir 3517223
truedvmdsi 6202031
divrs 9999026
dbltor 13463707
int2u 25350464
dblexpo 27269845
mulrrz_int 53799215
mantissa_real 54200615
invmod2BIL 60820357
trunc2nr 62836196
invr_basecase 65142138
invr 65142647
addmulii_gen 90685438
int2n 106540989
mulsr 120382679
truedvmdis 138855642
truedvmdii 141936081
addmulii 168737505
mulss 201183469
usqrt 252998606
rtodbl 295574031
addmulii_lg3 475538676
sqrz_i 562015212
sqrr 595485845
mulsi 617837003
sqru 640748141
mulrrz_3 658653056
mulur_2 723229752
mulrrz_3end 779510962
mulur 945865252
mulir 995683585
mului 1116026516
divru 1117616899
affrr 1379342972
addmulii_inplace 1617850431
sqri 2079346089
shifti 2288738949
vals 2318403551
modii 3121813068
mulrrz_end 3639165490
mulrrz_i 3792182688
mulrr 4040543885
muluu 4659796025
mulii 21173316907

Generated by: LCOV version 1.16