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 30586-ccf601f509) Lines: 535 567 94.4 %
Date: 2025-12-24 09:20:59 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 186650
mul0r 482320
sqrs 732247
divur 2508484
divir 3502226
truedvmdsi 6202031
divrs 9871303
dbltor 13383822
dblexpo 25892097
int2u 26082238
mantissa_real 53755028
mulrrz_int 53801066
invmod2BIL 60827507
trunc2nr 62676055
invr_basecase 62862260
invr 62862744
addmulii_gen 90744154
int2n 106043382
mulsr 117480444
truedvmdis 131095673
truedvmdii 134178890
addmulii 168693524
mulss 201178285
usqrt 231679719
rtodbl 288662446
addmulii_lg3 472781305
sqrz_i 556358837
sqrr 589177843
mulsi 610716297
sqru 626920848
mulrrz_3 652674456
mulur_2 705426946
mulrrz_3end 773309352
mulur 928053271
mulir 986865904
divru 1083962272
mului 1106413735
affrr 1343773364
addmulii_inplace 1581389444
sqri 1901014977
shifti 2260243220
vals 2275589036
modii 3079497932
mulrrz_end 3557508341
mulrrz_i 3710589812
mulrr 3957308515
muluu 4567507765
mulii 20973007713

Generated by: LCOV version 1.16