summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-11-07 16:38:58 +1100
committerjacqueline <me@jacqueline.id.au>2022-11-07 16:38:58 +1100
commit6584060296042d8af440b21024ee7996e5034ec1 (patch)
treec4bd79361894a669a1f2f2778f5dff01416f779a /test
parentc29c218b85a4fe7cff037ead66ef45966c1c6542 (diff)
downloadtangara-fw-6584060296042d8af440b21024ee7996e5034ec1.tar.gz
Add a unit test app + example tests
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt10
-rw-r--r--test/main/CMakeLists.txt1
-rw-r--r--test/main/main.c22
-rw-r--r--test/sdkconfig.defaults2
4 files changed, 35 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 00000000..ddcc063a
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.16)
+include(../common.cmake)
+
+# Treat warnings as errors for test purposes.
+list(APPEND EXTRA_WARNINGS "-Werror")
+
+# List all components that include tests here.
+set(TEST_COMPONENTS "drivers")
+
+project(device_tests)
diff --git a/test/main/CMakeLists.txt b/test/main/CMakeLists.txt
new file mode 100644
index 00000000..52a3b94c
--- /dev/null
+++ b/test/main/CMakeLists.txt
@@ -0,0 +1 @@
+idf_component_register(SRCS "main.c" INCLUDE_DIRS ".")
diff --git a/test/main/main.c b/test/main/main.c
new file mode 100644
index 00000000..6806aa2e
--- /dev/null
+++ b/test/main/main.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <string.h>
+#include "unity.h"
+
+static void print_banner(const char* text);
+
+void app_main(void)
+{
+ print_banner("Running tests without [ignore] tag");
+ UNITY_BEGIN();
+ unity_run_tests_by_tag("[ignore]", true);
+ UNITY_END();
+
+ print_banner("Starting interactive test menu");
+ unity_run_menu();
+}
+
+static void print_banner(const char* text)
+{
+ printf("\n#### %s #####\n\n", text);
+}
+
diff --git a/test/sdkconfig.defaults b/test/sdkconfig.defaults
new file mode 100644
index 00000000..80ff5eb3
--- /dev/null
+++ b/test/sdkconfig.defaults
@@ -0,0 +1,2 @@
+CONFIG_ESP_TASK_WDT=n
+