Add mock Arduino for x86_64 host-side testing

Complete Arduino API mock (mock_arduino.h/cpp) enabling application
code to compile and run on PC without hardware. Includes MockSerial,
String class, GPIO/analog/timing/interrupt mocks with state tracking
and test control API.

- Arduino.h, Wire.h, SPI.h shims intercept includes in test builds
- System test template (test_system.cpp) using SimHal
- CMakeLists.txt builds mock_arduino as static lib, links both suites
- Root test.sh/test.bat with --unit/--system/--clean/--verbose flags
- test.bat auto-detects MSVC via vswhere + vcvarsall.bat
- Doctor reports nuanced compiler status (on PATH vs installed)
- Refresh pulls mock infrastructure into existing projects
- 15 tests passing: 7 unit (MockHal) + 8 system (SimHal)
This commit is contained in:
Eric Ratliff
2026-02-20 08:21:11 -06:00
parent 1ae136530f
commit aa1e9d5043
13 changed files with 1831 additions and 16 deletions

View File

@@ -0,0 +1,15 @@
/*
* Arduino.h -- shim for host-side test builds.
*
* When compiling tests on x86_64, this file sits in the mocks/ include
* path and intercepts #include <Arduino.h> so that student code (or
* future libraries) that reference Arduino directly still compiles.
*
* Generated by Anvil.
*/
#ifndef ARDUINO_H_MOCK_SHIM
#define ARDUINO_H_MOCK_SHIM
#include "mock_arduino.h"
#endif // ARDUINO_H_MOCK_SHIM