velxio/test
David Montero Crespo 3197935461 feat: add ESP32 + ngspice co-simulation E2E tests
Three new end-to-end tests that combine ESP32 QEMU emulation (via backend
WebSocket) with ngspice-WASM analog circuit solving:

1. test_esp32_spice_analog.mjs — voltage divider sweep
   - Compiles a sketch that reads analogRead(34)
   - Solves two voltage dividers with ngspice (R1/R2=10k/10k then 10k/30k)
   - Injects solved V(mid) into ESP32's ADC via esp32_adc_set
   - Verifies Serial output matches within +-50 counts (12-bit ADC)
   - Confirms circuit change is detected (different ADC values)

2. test_esp32_spice_ntc_bridge.mjs — Wheatstone bridge temperature sweep
   - NTC thermistor in a bridge (0C / 25C / 50C)
   - ngspice solves the bridge for each temperature
   - ESP32 reads both legs (ADC34+ADC35), computes R_ntc and T via beta model
   - Verifies temperature within +-5C tolerance across sweep

3. test_esp32_spice_smoke.mjs — ngspice-only smoke test (no backend needed)

Also adds eecircuit-engine to test/backend/e2e/package.json.

Prerequisites: backend on localhost:8001 with esp32 core installed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 23:28:47 -03:00
..
backend feat: add ESP32 + ngspice co-simulation E2E tests 2026-04-15 23:28:47 -03:00
esp32 Fix MPU6050Slave I2C handling and add comprehensive tests 2026-04-09 02:04:41 -03:00
esp32-emulator feat: add ESP32 lcgamboa test suite, sketches and firmware binaries 2026-03-14 12:28:40 -03:00
multi_board feat: add multi-board integration tests for Raspberry Pi 3B and backend functionality 2026-03-13 00:15:14 -03:00
pi_arduino_serial feat: enhance AVR USART RX handling with software queue and improve logging 2026-03-12 22:11:06 -03:00
test_circuit feat: expand SPICE component catalog (fases 9 + 10) 2026-04-15 22:41:26 -03:00