From e1386212024f286311f4d23b3736dc06185057b2 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 4 Dec 2020 11:58:26 -0500 Subject: [PATCH] all triggers should be documented way nicer #2001 --- firmware/controllers/trigger/trigger_central.cpp | 5 +++++ unit_tests/main.cpp | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index e87bc694a8..5cc4957d51 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -520,6 +520,7 @@ static void triggerShapeInfo(void) { #if EFI_UNIT_TEST #include +extern trigger_type_e focusOnTrigger; #define TRIGGERS_FILE_NAME "triggers.txt" /** @@ -539,6 +540,10 @@ void printAllTriggers() { for (int triggerId = 1; triggerId < TT_UNUSED; triggerId++) { trigger_type_e tt = (trigger_type_e) triggerId; + if (focusOnTrigger != TT_UNUSED && tt != focusOnTrigger) { + continue; + } + printf("Exporting %s\r\n", getTrigger_type_e(tt)); persistent_config_s pc; diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index ec33a75362..607effab6e 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -35,13 +35,20 @@ extern bool printTriggerDebug; extern bool printTriggerTrace; bool verboseMode = false; +trigger_type_e focusOnTrigger = TT_UNUSED; + GTEST_API_ int main(int argc, char **argv) { -// printTriggerDebug = true; -// printTriggerTrace = true; + if (focusOnTrigger != TT_UNUSED) { + printTriggerDebug = true; + printTriggerTrace = true; + } // resizeMap(); printf("Success 20201203\r\n"); printAllTriggers(); + if (focusOnTrigger != TT_UNUSED) { + return; + } testing::InitGoogleTest(&argc, argv); // uncomment if you only want to run selected tests