reducing unit test noise

This commit is contained in:
rusefi 2019-08-25 01:15:18 -04:00
parent 415c2caae7
commit 8a4d3f9896
3 changed files with 17 additions and 9 deletions

View File

@ -32,6 +32,9 @@
EXTERN_ENGINE
;
#if EFI_UNIT_TEST
extern bool verboseMode;
#endif /* EFI_UNIT_TEST */
floatms_t getEngineCycleDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
return getCrankshaftRevolutionTimeMs(rpm) * (engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE) == TWO_STROKE ? 1 : 2);
@ -488,8 +491,10 @@ void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
}
#if EFI_UNIT_TEST
printf("prepareOutputSignals %d onlyEdge=%s %s\r\n", engineConfiguration->trigger.type, boolToString(engineConfiguration->useOnlyRisingEdgeForTrigger),
getIgnition_mode_e(engineConfiguration->ignitionMode));
if (verboseMode) {
printf("prepareOutputSignals %d onlyEdge=%s %s\r\n", engineConfiguration->trigger.type, boolToString(engineConfiguration->useOnlyRisingEdgeForTrigger),
getIgnition_mode_e(engineConfiguration->ignitionMode));
}
#endif /* EFI_UNIT_TEST */
for (int i = 0; i < CONFIG(specs.cylindersCount); i++) {

View File

@ -446,7 +446,7 @@ void printAllTriggers() {
fprintf(fp, "# This file is used by TriggerImage tool\n");
fprintf(fp, "# See 'gen_trigger_images.bat'\n");
printTriggerDebug = true;
//printTriggerDebug = true;
for (int triggerId = 1; triggerId < TT_UNUSED; triggerId++) {
trigger_type_e tt = (trigger_type_e) triggerId;

View File

@ -41,12 +41,13 @@ int getRevolutionCounter(void) {
}
extern bool printTriggerDebug;
bool verboseMode = false;
GTEST_API_ int main(int argc, char **argv) {
// printTriggerDebug = true;
// resizeMap();
printf("Success 20190808\r\n");
printf("Success 20190824\r\n");
printAllTriggers();
// printConvertedTable();
testing::InitGoogleTest(&argc, argv);
@ -68,9 +69,11 @@ void initLogging(LoggingWithStorage *logging, const char *name) {
}
void scheduleMsg(Logging *logging, const char *format, ...) {
va_list ap;
va_start(ap, format);
vprintf(format, ap);
va_end(ap);
printf("\r\n");
if (verboseMode) {
va_list ap;
va_start(ap, format);
vprintf(format, ap);
va_end(ap);
printf("\r\n");
}
}