mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
support Unity testing
This commit is contained in:
@@ -265,6 +265,8 @@ bool Test::test(const std::string & cmd, int8_t id1, int8_t id2) {
|
||||
|
||||
// These next tests are run from the Consol via the test command, so inherit the Shell
|
||||
void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const std::string & id1_s, const std::string & id2_s) {
|
||||
bool ok = false; // default tests fail
|
||||
|
||||
shell.add_flags(CommandFlags::ADMIN); // switch to su
|
||||
|
||||
// init stuff
|
||||
@@ -297,8 +299,6 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
id2 = Helpers::atoint(id2_s.c_str());
|
||||
}
|
||||
|
||||
bool ok = false;
|
||||
|
||||
// e.g. "test add 0x10 172"
|
||||
if (command == "add") {
|
||||
if (id1 == -1 || id2 == -1) {
|
||||
@@ -638,11 +638,11 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
Serial.print(COLOR_BRIGHT_MAGENTA);
|
||||
serializeJson(doc, Serial);
|
||||
Serial.print(COLOR_RESET);
|
||||
Serial.println();
|
||||
Serial.print(" measureMsgPack=");
|
||||
Serial.print(measureMsgPack(doc));
|
||||
Serial.print(" measureJson=");
|
||||
Serial.print(measureJson(doc));
|
||||
// Serial.println();
|
||||
// Serial.print(" measureMsgPack=");
|
||||
// Serial.print(measureMsgPack(doc));
|
||||
// Serial.print(" measureJson=");
|
||||
// Serial.print(measureJson(doc));
|
||||
Serial.println(" **");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user