aboutsummaryrefslogtreecommitdiffstats
path: root/build_and_test.bat
blob: 1a24334c856e8f74489e1a328006c94aa7e2cdd6 (plain)
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
setlocal enabledelayedexpansion

:: Default configurations
set default_configs=Debug Release

:: Check if a configuration is passed as an argument
if "%~1"=="" (
    set configs=%default_configs%
) else (
    set configs=%1
)

for %%c in (%configs%) do (
    echo Building %%c configuration...
    dotnet build --configuration %%c
    if errorlevel 1 (
        echo Error building %%c configuration
        exit /b 1
    )

    echo Running tests for %%c configuration...
    dotnet test --configuration %%c --no-build
    if errorlevel 1 (
        echo Error running tests for %%c configuration
        exit /b 1
    )
)

echo All specified configurations built and tested successfully!