@echo off rem Headless tests for the core crates. Needs an MSVC toolchain env for linking. rem The VS install path differs per machine (BuildTools / Community / VS version), rem so probe the usual spots and fall back to vswhere - same logic as dev.cmd. rem NOTE: ASCII only in this file - cmd.exe reads it in the OEM codepage. setlocal set "VCVARS=" for %%P in ( "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" ) do if not defined VCVARS if exist %%P set "VCVARS=%%~P" if defined VCVARS goto :have_vcvars set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" if not exist "%VSWHERE%" goto :no_vcvars for /f "usebackq delims=" %%I in (`"%VSWHERE%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VCVARS=%%I\VC\Auxiliary\Build\vcvarsall.bat" if not exist "%VCVARS%" goto :no_vcvars :have_vcvars call "%VCVARS%" x64 >nul where cargo >nul 2>nul if errorlevel 1 ( if exist "%USERPROFILE%\.cargo\bin\cargo.exe" ( set "PATH=%USERPROFILE%\.cargo\bin;%PATH%" ) else ( echo [test] cargo not found on PATH - install Rust ^(https://rustup.rs^) and reopen the shell. exit /b 1 ) ) cd /d "%~dp0..\src-tauri" cargo test --workspace %* exit /b %ERRORLEVEL% :no_vcvars echo [test] No MSVC toolchain found (vcvarsall.bat missing). echo [test] Install "Desktop development with C++" (VS Build Tools or VS Community), echo [test] or add: MSVC v14x x64/x86 build tools + Windows 11 SDK. exit /b 1