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) Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31053-95e3b72995) Lines: 94.3 % 562 530
Test Date: 2026-07-24 17:03:07 Functions: 96.2 % 52 50
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addmulii 169849648
addmulii_gen 92960915
addmulii_inplace 1631473218
addmulii_lg3 482972290
affrr 1424436239
dblexpo 27752123
dblmantissa 0
dbltor 13604263
div0r 0
divir 3278537
divrs 20390042
divru 1156629128
divsi 175
divsr 798
divur 2456238
int2n 109744236
int2u 25996714
int2um1 8807
invmod2BIL 61368762
invr 74746357
invr_basecase 74746357
mantissa_real 54677500
modii 3154711214
mul0r 481881
mulii 21996170510
mulir 1028146591
mulrr 4197059676
mulrrz_3 667109077
mulrrz_3end 790144359
mulrrz_end 3775417690
mulrrz_i 3946547133
mulrrz_int 54102156
mulsi 621294299
mulsr 132688777
mulss 201188895
mului 1168026446
mulur 974587249
mulur_2 759159789
muluu 4810117312
rtodbl 312564863
shifti 2323599674
sqri 1963621213
sqrr 602801893
sqrs 742866
sqru 648196261
sqrz_i 568775532
truedvmdii 142350569
truedvmdis 139090958
truedvmdsi 6202318
trunc2nr 62903940
usqrt 258734435
vals 2384242349

Generated by: LCOV version 2.0-1