support Unity testing

This commit is contained in:
proddy
2024-08-01 22:13:52 +02:00
parent 4ec5739b67
commit b38ec2f25e
16 changed files with 598 additions and 285 deletions

View File

@@ -1583,11 +1583,16 @@ EMSESP::EMSESP()
// start all the core services
// the services must be loaded in the correct order
void EMSESP::start() {
// don't need shell if running unit tests
#if !defined(UNITY_INCLUDE_CONFIG_H)
serial_console_.begin(SERIAL_CONSOLE_BAUD_RATE);
shell_ = std::make_shared<EMSESPConsole>(*this, serial_console_, true);
shell_->maximum_log_messages(100);
shell_->start();
#if defined(EMSESP_DEBUG)
shell_->log_level(uuid::log::Level::DEBUG);
#else
@@ -1598,6 +1603,8 @@ void EMSESP::start() {
shell_->add_flags(CommandFlags::ADMIN); // always start in su/admin mode when running tests
#endif
#endif
// start the file system
#ifndef EMSESP_STANDALONE
if (!LittleFS.begin(true)) {