-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_test.cmd
More file actions
31 lines (31 loc) · 1013 Bytes
/
_test.cmd
File metadata and controls
31 lines (31 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@echo off
REM Host-side test runner. Compiles test/test_main.c with a regular host
REM C compiler and runs it. No ESP-IDF involvement.
REM
REM Usage: _test.cmd
REM
REM Requires gcc on PATH (install MSYS2 / MinGW-w64 or WSL on Windows;
REM Linux + macOS have gcc/clang out of the box). CI runs the same
REM test via the host-test job in .github/workflows/build.yml — local
REM run is optional.
where gcc >nul 2>nul
if errorlevel 1 (
echo gcc not found on PATH.
echo.
echo Local host tests need a regular C compiler. Either:
echo - install MSYS2 ^(https://www.msys2.org/^) and run pacman -S mingw-w64-x86_64-gcc
echo - install WSL and run apt-get install gcc
echo - or just rely on CI ^(github.com/MMBytes/MultiGeiger-V2/actions^)
echo.
exit /b 1
)
cd /d "%~dp0"
gcc -I main -Wall -Wextra -Werror -std=c11 -o test\run.exe test\test_main.c
if errorlevel 1 (
echo Build failed.
exit /b 1
)
test\run.exe
set "RC=%ERRORLEVEL%"
del test\run.exe >nul 2>nul
exit /b %RC%