Table of Contents
Code Coverage
pgBackRest aims to have complete function/branch/line coverage for the core C code in /src.
Function/line coverage is complete with no exceptions.
Branch coverage excludes branches inside macros and assert() calls. Macros have their own unit tests so they do not need to be tested everywhere they appear. Asserts are not expected to have complete branch coverage since they test cases that should always be true.
Directory Functions Branches Lines
build/common 23/23 (100.00%) 56/56 (100.00%) 212/212 (100.00%)
build/config 39/39 (100.00%) 526/526 (100.00%) 1122/1122 (100.00%)
build/error 6/6 (100.00%) 26/26 (100.00%) 78/78 (100.00%)
build/help 13/13 (100.00%) 134/134 (100.00%) 262/262 (100.00%)
build/postgres 8/8 (100.00%) 60/60 (100.00%) 151/151 (100.00%)
command 15/15 (100.00%) 94/94 (100.00%) 187/187 (100.00%)
command/annotate 1/1 (100.00%) 12/12 (100.00%) 30/30 (100.00%)
command/archive 15/15 (100.00%) 104/104 (100.00%) 200/200 (100.00%)
command/archive/get 9/9 (100.00%) 200/200 (100.00%) 433/433 (100.00%)
command/archive/push 12/12 (100.00%) 130/130 (100.00%) 348/348 (100.00%)
command/backup 50/50 (100.00%) 794/794 (100.00%) 1643/1643 (100.00%)
command/check 13/13 (100.00%) 106/106 (100.00%) 214/214 (100.00%)
command/control 4/4 (100.00%) 34/34 (100.00%) 48/48 (100.00%)
command/expire 10/10 (100.00%) 244/244 (100.00%) 359/359 (100.00%)
command/help 8/8 (100.00%) 178/178 (100.00%) 283/283 (100.00%)
command/info 15/15 (100.00%) 412/412 (100.00%) 709/709 (100.00%)
command/local 1/1 (100.00%) --- 4/4 (100.00%)
command/remote 1/1 (100.00%) 6/6 (100.00%) 18/18 (100.00%)
command/repo 9/9 (100.00%) 110/110 (100.00%) 205/205 (100.00%)
command/restore 37/37 (100.00%) 726/726 (100.00%) 1350/1350 (100.00%)
command/server 6/6 (100.00%) 24/24 (100.00%) 79/79 (100.00%)
command/stanza 5/5 (100.00%) 106/106 (100.00%) 125/125 (100.00%)
command/verify 22/22 (100.00%) 356/356 (100.00%) 721/721 (100.00%)
common 144/144 (100.00%) 614/614 (100.00%) 1327/1327 (100.00%)
common/compress 12/12 (100.00%) 24/24 (100.00%) 80/80 (100.00%)
common/compress/bz2 13/13 (100.00%) 20/20 (100.00%) 123/123 (100.00%)
common/compress/gz 13/13 (100.00%) 26/26 (100.00%) 118/118 (100.00%)
common/compress/lz4 15/15 (100.00%) 24/24 (100.00%) 116/116 (100.00%)
common/compress/zst 13/13 (100.00%) 12/12 (100.00%) 96/96 (100.00%)
common/crypto 32/32 (100.00%) 88/88 (100.00%) 424/424 (100.00%)
common/error 33/33 (100.00%) 62/62 (100.00%) 178/178 (100.00%)
common/io 59/59 (100.00%) 174/174 (100.00%) 499/499 (100.00%)
common/io/filter 31/31 (100.00%) 92/92 (100.00%) 276/276 (100.00%)
common/io/http 57/57 (100.00%) 274/274 (100.00%) 670/670 (100.00%)
common/io/socket 28/28 (100.00%) 110/110 (100.00%) 337/337 (100.00%)
common/io/tls 36/36 (100.00%) 114/114 (100.00%) 393/393 (100.00%)
common/type 332/332 (100.00%) 924/924 (100.00%) 3109/3109 (100.00%)
config 91/91 (100.00%) 985/986 (99.90%) 1609/1609 (100.00%)
db 23/23 (100.00%) 118/118 (100.00%) 317/317 (100.00%)
info 93/93 (100.00%) 938/938 (100.00%) 2032/2032 (100.00%)
postgres 36/36 (100.00%) 126/126 (100.00%) 329/329 (100.00%)
postgres/interface 4/4 (100.00%) 10/10 (100.00%) 35/35 (100.00%)
protocol 60/60 (100.00%) 264/264 (100.00%) 859/859 (100.00%)
storage 61/61 (100.00%) 260/260 (100.00%) 678/678 (100.00%)
storage/azure 26/26 (100.00%) 138/138 (100.00%) 398/398 (100.00%)
storage/cifs 2/2 (100.00%) --- 6/6 (100.00%)
storage/gcs 35/35 (100.00%) 182/182 (100.00%) 582/582 (100.00%)
storage/posix 28/28 (100.00%) 167/168 (99.40%) 324/324 (100.00%)
storage/remote 38/38 (100.00%) 128/128 (100.00%) 572/572 (100.00%)
storage/s3 30/30 (100.00%) 186/186 (100.00%) 585/585 (100.00%)
storage/sftp 32/32 (100.00%) 404/404 (100.00%) 712/712 (100.00%)
TOTAL 1699/1699 (100.00%) 10902/10904 (99.98%) 25565/25565 (100.00%)
The C unit test modules in /test/src/module also have complete function/line coverage but are not included in the report.