GCC Code Coverage Report


Directory: ./
File: unit_tests/main.cpp
Date: 2025-11-16 14:52:24
Coverage Exec Excl Total
Lines: 69.2% 9 0 13
Functions: 100.0% 1 0 1
Branches: 30.0% 3 0 10
Decisions: 50.0% 2 - 4

Line Branch Decision Exec Source
1 /**
2 * @file main.cpp
3 * @file Unit tests (and some integration tests to be fair) of rusEFI
4 *
5 * @author Andrey Belomutskiy, (c) 2012-2021
6 */
7
8
9 #include "pch.h"
10 #include <stdlib.h>
11
12 bool hasInitGtest = false;
13
14 1 GTEST_API_ int main(int argc, char **argv) {
15
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
1/2
✗ Decision 'true' not taken.
✓ Decision 'false' taken 1 time.
1 if (argc == 2 && strcmp(argv[1], "ltft_sandbox") == 0) {
16 void runLtftSandbox();
17 // feed real log sensor data into our logic
18 runLtftSandbox();
19 return 0;
20 }
21
22
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
1/2
✗ Decision 'true' not taken.
✓ Decision 'false' taken 1 time.
1 if (argc == 2 && strcmp(argv[1], "replay_log") == 0) {
23 void runLogReplay();
24 // feed real log sensor data into our logic
25 runLogReplay();
26 return 0;
27 }
28
29 1 hasInitGtest = true;
30
31 1 testing::InitGoogleTest(&argc, argv);
32 // uncomment if you only want to run selected tests
33 /**
34 * See TEST_FROM_TRIGGER_ID to limit test just for last trigger
35 */
36 // todo: can we check argc or argv and setVerboseTrigger(true) dynamically if invoked with AllTriggersFixture?
37 // command line AllTriggersFixture #7946
38 // setVerboseTrigger(true);
39 // --gtest_filter=*TEST_NAME*
40 //::testing::GTEST_FLAG(filter) = "*AllTriggersFixture*";
41 1 int result = RUN_ALL_TESTS();
42 // windows ERRORLEVEL in Jenkins batch file seems to want negative value to detect failure
43
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 int returnCode = result == 0 ? 0 : -1;
44 1 printf("DONE returning %d\n", returnCode);
45 1 return returnCode;
46 }
47