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

Generated by: LCOV version 2.0-1