mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
Merge pull request #2447 from philwingfield/fix_unit_tests
Fix console unit tests due to changed shell output
This commit is contained in:
@@ -28,6 +28,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
|
||||
- thermostat date [#2313](https://github.com/emsesp/EMS-ESP32/issues/2313)
|
||||
- Updated unknown compressor stati "enum_hpactivity" [#2311](https://github.com/emsesp/EMS-ESP32/pull/2311)
|
||||
- Underline Tab headers in WebUI
|
||||
- console unit tests fixed due to changed shell output
|
||||
|
||||
## Changed
|
||||
|
||||
|
||||
@@ -292,13 +292,16 @@ void run_manual_tests() {
|
||||
const char * run_console_command(const char * command) {
|
||||
output_buffer[0] = '\0'; // empty the temp buffer
|
||||
shell->invoke_command(command);
|
||||
// remove everything before \r\n
|
||||
|
||||
// The buffer now contains a prompt, the command, the output and a \r\n
|
||||
// remove the \r\n at the end
|
||||
char * p = strstr(output_buffer, "\r\n");
|
||||
if (p) {
|
||||
p += 2; // skip the \r\n
|
||||
*p = '\0';
|
||||
}
|
||||
// remove the \r\n at the end
|
||||
p[strlen(p) - 2] = '\0';
|
||||
|
||||
// Now go to just after the prompt and command
|
||||
p = output_buffer + 7 + strlen(command);
|
||||
|
||||
// Serial.println("Output:");
|
||||
// Serial.print(p);
|
||||
|
||||
Reference in New Issue
Block a user