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 30536-6f6fcf9613) Lines: 535 567 94.4 %
Date: 2025-11-05 09:21:39 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 187461
mul0r 482296
sqrs 731428
divur 2509036
divir 3503352
truedvmdsi 6202031
divrs 9869866
dbltor 13388738
dblexpo 25880675
int2u 26154533
mantissa_real 53613004
mulrrz_int 53800618
invmod2BIL 60744881
trunc2nr 62697833
invr_basecase 62829947
invr 62831118
addmulii_gen 90744342
int2n 105938719
mulsr 117487218
truedvmdis 130861706
truedvmdii 133944060
addmulii 168634374
mulss 201177817
usqrt 232063505
rtodbl 288816207
addmulii_lg3 472707660
sqrz_i 555656944
sqrr 588475854
mulsi 609232466
sqru 626938816
mulrrz_3 652670858
mulur_2 704653522
mulrrz_3end 773384744
mulur 927200326
mulir 985904849
divru 1083212084
mului 1107352132
affrr 1342991376
addmulii_inplace 1581301904
sqri 1911535219
vals 2267474718
shifti 2269060928
modii 3083143620
mulrrz_end 3555230158
mulrrz_i 3709800345
mulrr 3955778434
muluu 4562815397
mulii 20973256784

Generated by: LCOV version 1.16