Anvil v1.0.0 -- Arduino build tool with HAL and test scaffolding
Single-binary CLI that scaffolds testable Arduino projects, compiles, uploads, and monitors serial output. Templates embed a hardware abstraction layer, Google Mock infrastructure, and CMake-based host tests so application logic can be verified without hardware. Commands: new, doctor, setup, devices, build, upload, monitor 39 Rust tests (21 unit, 18 integration) Cross-platform: Linux and Windows
This commit is contained in:
42
templates/basic/test/run_tests.bat
Normal file
42
templates/basic/test/run_tests.bat
Normal file
@@ -0,0 +1,42 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set SCRIPT_DIR=%~dp0
|
||||
set BUILD_DIR=%SCRIPT_DIR%build
|
||||
|
||||
if "%1"=="--clean" (
|
||||
if exist "%BUILD_DIR%" (
|
||||
echo Cleaning build directory...
|
||||
rmdir /s /q "%BUILD_DIR%"
|
||||
)
|
||||
)
|
||||
|
||||
if not exist "%BUILD_DIR%\CMakeCache.txt" (
|
||||
echo Configuring (first run will fetch Google Test)...
|
||||
cmake -S "%SCRIPT_DIR%" -B "%BUILD_DIR%" -DCMAKE_BUILD_TYPE=Debug
|
||||
if errorlevel 1 (
|
||||
echo FAIL: cmake configure failed
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
echo Building tests...
|
||||
cmake --build "%BUILD_DIR%" --parallel
|
||||
if errorlevel 1 (
|
||||
echo FAIL: build failed
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Running tests...
|
||||
echo.
|
||||
|
||||
ctest --test-dir "%BUILD_DIR%" --output-on-failure
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo FAIL: Some tests failed.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo PASS: All tests passed.
|
||||
Reference in New Issue
Block a user