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