Skip to content

Commit

Permalink
Tests: fixed logging
Browse files Browse the repository at this point in the history
  • Loading branch information
PBrunot committed May 26, 2024
1 parent aba97a3 commit 88be290
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/test_logic/test_logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ void setUp(void)
void setup()
{
delay(1000);
esp_log_level_set(TAG, LOG_LOCAL_LEVEL);

auto config = fabomatic::SavedConfig::LoadFromEEPROM();
UNITY_BEGIN();
RUN_TEST(fabomatic::tests::test_machine_defaults);
Expand Down
4 changes: 3 additions & 1 deletion test/test_mqtt/test_mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ namespace fabomatic::tests
for (const auto tp : test_scheduler.getTasks())
{
const auto t = *tp;
ESP_LOGD(TAG3, "Task %s: %lu runs, %lu ms total runtime, %lu ms avg tardiness", t.getId().c_str(), t.getRunCounter(), t.getTotalRuntime().count(), t.getAvgTardiness().count());
ESP_LOGD(TAG3, "Task %s: %lu runs, %llu ms total runtime, %llu ms avg tardiness", t.getId().c_str(), t.getRunCounter(), t.getTotalRuntime().count(), t.getAvgTardiness().count());
TEST_ASSERT_GREATER_OR_EQUAL_MESSAGE(1, t.getRunCounter(), "Task did not run");
}
// Remove the HW Watchdog
Expand All @@ -353,6 +353,8 @@ void setUp(void)
void setup()
{
delay(1000);
esp_log_level_set(TAG, LOG_LOCAL_LEVEL);

// Save original config
auto original = fabomatic::SavedConfig::LoadFromEEPROM();

Expand Down
2 changes: 2 additions & 0 deletions test/test_savedconfig/test_savedconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ void setUp(void)
void setup()
{
delay(1000);
esp_log_level_set(TAG, LOG_LOCAL_LEVEL);

auto original = fabomatic::SavedConfig::LoadFromEEPROM();

UNITY_BEGIN();
Expand Down
2 changes: 2 additions & 0 deletions test/test_tasks/test_tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define UNITY_INCLUDE_PRINT_FORMATTED
#include <unity.h>
#include "Tasks.hpp"
#include "Logging.hpp"

using namespace std::chrono_literals;

Expand Down Expand Up @@ -132,6 +133,7 @@ namespace fabomatic::tests
void setup()
{
delay(1000);
esp_log_level_set(TAG, LOG_LOCAL_LEVEL);
UNITY_BEGIN();
RUN_TEST(fabomatic::tests::test_execute_runs_all_tasks);
RUN_TEST(fabomatic::tests::test_stop_start_tasks);
Expand Down

0 comments on commit 88be290

Please sign in to comment.