Files
UA-.NETStandard/tests/customtest.bat
T
2026-07-16 06:25:54 +02:00

50 lines
1.5 KiB
Batchfile

@echo off
setlocal enabledelayedexpansion
echo This script is used to run custom platform tests for the UA Core Library
echo Supported parameters: netstandard2.0, netstandard2.1, net472, net48, net8.0, net9.0, net10.0
REM Check if the target framework parameter is provided
if "%1"=="" (
echo Usage: %0 [TargetFramework]
echo Allowed values for TargetFramework: netstandard2.0, netstandard2.1, net472, net48, net8.0, net9.0, net10.0, default
goto :eof
)
REM Check if the provided TargetFramework is valid
set "validFrameworks= default netstandard2.0 netstandard2.1 net472 net48 net8.0 net9.0 net10.0 "
if "!validFrameworks: %1 =!"=="%validFrameworks%" (
echo Invalid TargetFramework specified. Allowed values are: netstandard2.0, netstandard2.1, net472, net48, net8.0, net9.0, net10.0, default
goto :eof
)
if "%1"=="default" (
echo Using the default targets for the test runners.
goto :cleanup
)
REM this is the variable used to switch the build scripts to a dedicated target
echo Using the %1 CustomTestTargets for the test runners.
set CustomTestTarget=%1
:cleanup
REM clean up all obj and bin folders
REM Set the root directory path as batch file location
set "root=%~dp0"
REM Delete 'obj' and 'bin' folders
for /d /r "%root%" %%d in (*obj *bin) do (
echo Deleting "%%d"
del /S /F /Q "%%d\*.*"
rmdir /s /q "%%d"
)
echo Clean up complete.
echo restore %1
dotnet restore -f "..\UA.slnx"
dotnet build --no-restore "..\UA.slnx"
dotnet test "..\UA.slnx"