GCC Code Coverage Report


Directory: ./
File: firmware/libfirmware/util/include/rusefi/manifest.h
Date: 2025-11-16 14:52:24
Coverage Exec Excl Total
Lines: 100.0% 15 0 15
Functions: 100.0% 4 0 4
Branches: 46.2% 12 0 26
Decisions: 50.0% 1 - 2

Line Branch Decision Exec Source
1 #pragma once
2
3 // https://stackoverflow.com/questions/46899202/how-to-split-date-and-time-macros-into-individual-components-for-variabl
4 1186 constexpr int compilationDatePortion(const int startIndex, const int totalChars) {
5
6 1186 int result = 0;
7 1186 for (int i = startIndex + totalChars - 1, multiplier = 1;
8
2/2
✓ Branch 0 taken 3558 times.
✓ Branch 1 taken 1186 times.
4744 i >= startIndex;
9 3558 i--, multiplier *= 10) {
10 3558 const char c = __DATE__[i];
11
1/2
✓ Branch 0 taken 3558 times.
✗ Branch 1 not taken.
1/2
✓ Decision 'true' taken 3558 times.
✗ Decision 'false' not taken.
3558 if (c != ' ') {
12 3558 result += (c - '0') * multiplier;
13 }
14 }
15
16 1186 return result;
17 }
18
19 593 constexpr int compilationYear() {
20 593 return compilationDatePortion(7, 4);
21 }
22
23 593 constexpr int compilationDay() {
24 593 return compilationDatePortion(4, 2);
25 }
26
27 // https://stackoverflow.com/questions/19760221/c-get-the-month-as-number-at-compile-time
28
29 #define __COMPILATION_MONTH__ (\
30 __DATE__ [2] == 'n' ? (__DATE__ [1] == 'a' ? 1 : 6) \
31 : __DATE__ [2] == 'b' ? 2 \
32 : __DATE__ [2] == 'r' ? (__DATE__ [0] == 'M' ? 3 : 4) \
33 : __DATE__ [2] == 'y' ? 5 \
34 : __DATE__ [2] == 'l' ? 7 \
35 : __DATE__ [2] == 'g' ? 8 \
36 : __DATE__ [2] == 'p' ? 9 \
37 : __DATE__ [2] == 't' ? 10 \
38 : __DATE__ [2] == 'v' ? 11 \
39 : 12)
40
41 593 constexpr int compilationMonth() {
42
9/22
✗ Branch 0 not taken.
✓ Branch 1 taken 593 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 593 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 593 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 593 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 593 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 593 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 593 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 593 times.
✗ Branch 19 not taken.
✓ Branch 20 taken 593 times.
✗ Branch 21 not taken.
593 return __COMPILATION_MONTH__;
43 }
44