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 30773-2078653b96) Lines: 535 567 94.4 %
Date: 2026-04-02 09:26:53 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168729657
addmulii_gen 90690437
addmulii_inplace 1617814995
addmulii_lg3 475492580
affrr 1378385499
dblexpo 27264874
dblmantissa 0
dbltor 13463252
div0r 186614
divir 3517221
divrs 9999077
divru 1117350748
divsi 175
divsr 798
divur 2524357
int2n 108508431
int2u 25349868
int2um1 8831
invmod2BIL 60819575
invr 65142856
invr_basecase 65142431
mantissa_real 54199904
modii 3123082907
mul0r 482281
mulii 21146823294
mulir 994636657
mulrr 4039218392
mulrrz_3 658254930
mulrrz_3end 778954941
mulrrz_end 3638551706
mulrrz_i 3789521750
mulrrz_int 53799215
mulsi 617830416
mulsr 120368289
mulss 201177968
mului 1113554593
mulur 945028041
mulur_2 722594062
muluu 4648006962
rtodbl 295542127
shifti 2285978088
sqri 2076902975
sqrr 595345086
sqrs 732801
sqru 640025896
sqrz_i 561722264
truedvmdii 141909356
truedvmdis 138827230
truedvmdsi 6202031
trunc2nr 62833565
usqrt 251439556
vals 2315955806

Generated by: LCOV version 1.16