From 01cf6ed26fabfa88ca3117559ce7459625d32d0c Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Tue, 11 Aug 2026 12:23:07 +0900 Subject: [PATCH] Enable firmware tests Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- tests/firmware/CMakeLists.txt | 24 ++++++++++++++++++++++++ tests/firmware/test_main.cpp | 12 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/firmware/CMakeLists.txt create mode 100644 tests/firmware/test_main.cpp diff --git a/tests/firmware/CMakeLists.txt b/tests/firmware/CMakeLists.txt new file mode 100644 index 0000000..2d26b4d --- /dev/null +++ b/tests/firmware/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.13) + +project(switch-pico-firmware-tests LANGUAGES CXX) + +enable_testing() + +add_executable(switch-pico-firmware-tests + ../../switch2_commands.cpp + ../../switch2_descriptors.cpp + ../../switch2_reports.cpp + ../../switch_uart_protocol.cpp + test_main.cpp + test_legacy_descriptors.cpp + test_switch2_commands.cpp + test_switch2_descriptors.cpp + test_switch2_reports.cpp + test_switch_input.cpp + test_switch_uart_protocol.cpp +) + +target_compile_features(switch-pico-firmware-tests PRIVATE cxx_std_17) +target_include_directories(switch-pico-firmware-tests PRIVATE ../..) + +add_test(NAME switch-pico-firmware-tests COMMAND switch-pico-firmware-tests) diff --git a/tests/firmware/test_main.cpp b/tests/firmware/test_main.cpp new file mode 100644 index 0000000..d8b7ba8 --- /dev/null +++ b/tests/firmware/test_main.cpp @@ -0,0 +1,12 @@ +#include "test_support.h" + +int main() { + TestRunner runner; + run_legacy_descriptor_tests(runner); + run_switch2_command_tests(runner); + run_switch2_descriptor_tests(runner); + run_switch2_report_tests(runner); + run_switch_input_tests(runner); + run_switch_uart_protocol_tests(runner); + return runner.result(); +}