GCC Code Coverage Report


Directory: ./
File: tests/unit/extra_tests.h
Date: 2026-11-30 15:03:27
Exec Total Coverage
Lines: 3 3 100.0%
Functions: 1 1 100.0%
Branches: 2 4 50.0%

Line Branch Exec Source
1 /*********************************************************************************/
2 /* Copyright 2009-2025 Barcelona Supercomputing Center */
3 /* */
4 /* This file is part of the DLB library. */
5 /* */
6 /* DLB is free software: you can redistribute it and/or modify */
7 /* it under the terms of the GNU Lesser General Public License as published by */
8 /* the Free Software Foundation, either version 3 of the License, or */
9 /* (at your option) any later version. */
10 /* */
11 /* DLB is distributed in the hope that it will be useful, */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* GNU Lesser General Public License for more details. */
15 /* */
16 /* You should have received a copy of the GNU Lesser General Public License */
17 /* along with DLB. If not, see <https://www.gnu.org/licenses/>. */
18 /*********************************************************************************/
19
20 #ifndef EXTRA_TESTS_T
21 #define EXTRA_TESTS_T
22
23 #include <stdbool.h>
24 #include <stdlib.h>
25 #include <string.h>
26
27 /* Set the environment variable DLB_EXTRA_TESTS=1 to enable the execution of
28 * additional CPU-intensive or fork-intensive tests */
29
30 #define DLB_EXTRA_TESTS dlb_extra_tests()
31
32 6 static inline bool dlb_extra_tests(void) {
33 6 const char *env = getenv("DLB_EXTRA_TESTS");
34
2/4
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
6 return env && env[0] == '1';
35 }
36
37 #endif /* EXTRA_TESTS_T */
38