summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-06-27 16:12:43 +1000
committerjacqueline <me@jacqueline.id.au>2024-06-27 16:12:43 +1000
commit688fe79471625762bd6f3816dec9cef7f7cfb2e1 (patch)
tree99404dea80650d805e094d3da26641bda3058c6d /test
parent1036f1b00efe2bbd2467cbfa3a4a97ab7f56591e (diff)
downloadtangara-fw-688fe79471625762bd6f3816dec9cef7f7cfb2e1.tar.gz
require a key press before entering the dev console
this improves our ability to detect terminals that support line editing
Diffstat (limited to 'test')
-rw-r--r--test/main/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/main/main.cpp b/test/main/main.cpp
index 57be6b24..58100766 100644
--- a/test/main/main.cpp
+++ b/test/main/main.cpp
@@ -5,9 +5,13 @@
*/
#include <stdio.h>
+#include <sys/fcntl.h>
+#include <sys/unistd.h>
#include <cstdint>
+#include "freertos/FreeRTOS.h"
+
#include "catch_runner.hpp"
#include "esp_console.h"
#include "esp_log.h"
@@ -27,6 +31,13 @@ void RegisterCatch2() {
namespace console {
class TestConsole : public Console {
+ public:
+ virtual auto PrerunCallback() -> void {
+ char* arg = "catch";
+ exec_catch2(1, &arg);
+ Console::PrerunCallback();
+ }
+
protected:
virtual auto RegisterExtraComponents() -> void { RegisterCatch2(); }
virtual auto GetStackSizeKiB() -> uint16_t {