rusefi-1/unit_tests/main.cpp

61 lines
1.2 KiB
C++
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file main.cpp
* @file First step towards unit-testing rusEfi algorithms
*
2020-04-18 19:46:22 -07:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2017-01-02 12:03:26 -08:00
2018-09-16 20:10:06 -07:00
#include <stdlib.h>
2015-07-10 06:01:56 -07:00
2018-09-16 19:39:46 -07:00
#include "global.h"
2015-07-10 06:01:56 -07:00
#include "engine_configuration.h"
#include "test_signal_executor.h"
#include "trigger_central.h"
#include "map_resize.h"
#include "engine_math.h"
#include "engine_test_helper.h"
2019-01-03 17:14:23 -08:00
#include "gtest/gtest.h"
2015-07-10 06:01:56 -07:00
2018-03-04 13:30:03 -08:00
int timeNowUs = 0;
2015-07-10 06:01:56 -07:00
efitimeus_t getTimeNowUs(void) {
2018-03-04 13:30:03 -08:00
return timeNowUs;
2015-07-10 06:01:56 -07:00
}
efitick_t getTimeNowNt(void) {
return getTimeNowUs() * US_TO_NT_MULTIPLIER;
}
2018-03-04 18:32:48 -08:00
LoggingWithStorage sharedLogger("main");
2017-03-03 21:23:31 -08:00
extern bool printTriggerDebug;
2019-08-24 22:15:18 -07:00
bool verboseMode = false;
2015-07-10 06:01:56 -07:00
2019-01-03 17:14:23 -08:00
GTEST_API_ int main(int argc, char **argv) {
2017-03-03 21:23:31 -08:00
// printTriggerDebug = true;
2015-07-10 06:01:56 -07:00
// resizeMap();
2020-05-09 21:59:32 -07:00
printf("Success 20200510\r\n");
2015-07-10 06:01:56 -07:00
printAllTriggers();
2019-01-03 17:14:23 -08:00
testing::InitGoogleTest(&argc, argv);
2019-01-08 18:40:21 -08:00
// uncomment if you only want to run selected tests
//::testing::GTEST_FLAG(filter) = "*testFasterEngineSpinningUp*";
2019-02-01 19:40:24 -08:00
int result = RUN_ALL_TESTS();
2019-02-01 19:55:35 -08:00
// windows ERRORLEVEL in Jenkins batch file seems to want negative value to detect failure
2019-02-01 19:40:24 -08:00
return result == 0 ? 0 : -1;
2015-07-10 06:01:56 -07:00
}
void print(const char *format, ...) {
va_list ap;
va_start(ap, format);
vprintf(format, ap);
va_end(ap);
}
void initLogging(LoggingWithStorage *logging, const char *name) {
}