2018-12-27 23:22:46 +00:00
|
|
|
REM Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
REM Licensed under the MIT License.
|
|
|
|
|
|
2019-05-20 22:48:14 +00:00
|
|
|
@ECHO ON
|
2018-12-27 23:22:46 +00:00
|
|
|
SETLOCAL EnableDelayedExpansion
|
|
|
|
|
|
2024-09-04 22:21:23 +00:00
|
|
|
SET TargetFramework=net8.0
|
2019-05-20 22:48:14 +00:00
|
|
|
SET TargetArch=x64
|
|
|
|
|
SET dn="C:\Program Files\dotnet\dotnet"
|
2021-08-19 00:26:34 +00:00
|
|
|
SET CurrentOnnxRuntimeVersion=""
|
2019-05-20 22:48:14 +00:00
|
|
|
|
|
|
|
|
SET LocalNuGetRepo=%1
|
|
|
|
|
IF NOT "%2"=="" (SET TargetFramework=%2)
|
|
|
|
|
IF NOT "%3"=="" (SET TargetArch=%3)
|
2019-09-30 23:24:16 +00:00
|
|
|
IF NOT "%4"=="" (
|
|
|
|
|
SET CurrentOnnxRuntimeVersion=%4
|
|
|
|
|
) ELSE (
|
|
|
|
|
echo "Usage: runtest.bat LocalNuGetRepoPath TargetFramework TargetArch NuGetPackageVersion"
|
|
|
|
|
)
|
2019-05-20 22:48:14 +00:00
|
|
|
|
2020-02-25 07:02:59 +00:00
|
|
|
IF "%TargetArch%"=="x64" (
|
|
|
|
|
SET RuntimeIdentifier=win-x64
|
|
|
|
|
SET PlatformTarget=x64
|
|
|
|
|
)
|
|
|
|
|
|
2019-05-20 22:48:14 +00:00
|
|
|
IF "%TargetArch%"=="x86" (
|
|
|
|
|
SET dn="C:\Program Files (x86)\dotnet\dotnet"
|
|
|
|
|
SET RuntimeIdentifier=win-x86
|
|
|
|
|
SET PlatformTarget=x86
|
|
|
|
|
)
|
|
|
|
|
|
2019-03-20 17:37:09 +00:00
|
|
|
ECHO Target Framework is %TargetFramework%
|
2019-05-20 22:48:14 +00:00
|
|
|
|
2019-06-21 02:41:30 +00:00
|
|
|
REM Update if CUDA lib paths if set
|
|
|
|
|
SET PATH=%CUDA_PATH%\bin;%CUDNN_PATH%\bin;%PATH%
|
|
|
|
|
|
2020-02-25 07:02:59 +00:00
|
|
|
IF EXIST test\Microsoft.ML.OnnxRuntime.EndToEndTests\packages RMDIR /S /Q test\Microsoft.ML.OnnxRuntime.EndToEndTests\packages
|
|
|
|
|
IF EXIST test\Microsoft.ML.OnnxRuntime.EndToEndTests\bin RMDIR /S /Q test\Microsoft.ML.OnnxRuntime.EndToEndTests\bin
|
|
|
|
|
IF EXIST test\Microsoft.ML.OnnxRuntime.EndToEndTests\obj RMDIR /S /Q test\Microsoft.ML.OnnxRuntime.EndToEndTests\obj
|
|
|
|
|
|
2021-08-19 00:26:34 +00:00
|
|
|
@echo %PackageName%
|
2018-12-27 23:22:46 +00:00
|
|
|
@echo %CurrentOnnxRuntimeVersion%
|
2020-02-25 07:02:59 +00:00
|
|
|
%dn% clean test\Microsoft.ML.OnnxRuntime.EndToEndTests\Microsoft.ML.OnnxRuntime.EndToEndTests.csproj
|
2021-10-27 10:07:07 +00:00
|
|
|
%dn% restore -v normal test\Microsoft.ML.OnnxRuntime.EndToEndTests\Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --configfile .\Nuget.CSharp.config --no-cache --packages test\Microsoft.ML.OnnxRuntime.EndToEndTests\packages --source https://api.nuget.org/v3/index.json --source %LocalNuGetRepo%
|
|
|
|
|
|
2019-06-21 02:41:30 +00:00
|
|
|
|
2019-05-20 22:48:14 +00:00
|
|
|
IF NOT errorlevel 0 (
|
2018-12-27 23:22:46 +00:00
|
|
|
@echo "Failed to restore nuget packages for the test project"
|
2019-05-20 22:48:14 +00:00
|
|
|
EXIT 1
|
2018-12-27 23:22:46 +00:00
|
|
|
)
|
|
|
|
|
|
2021-08-19 00:26:34 +00:00
|
|
|
%dn% list test\Microsoft.ML.OnnxRuntime.EndToEndTests\Microsoft.ML.OnnxRuntime.EndToEndTests.csproj package
|
|
|
|
|
dir test\Microsoft.ML.OnnxRuntime.EndToEndTests\packages\
|
|
|
|
|
|
2023-12-22 08:57:16 +00:00
|
|
|
set gpu_package=F
|
|
|
|
|
IF "%PACKAGENAME%"=="Microsoft.ML.OnnxRuntime.Gpu" set gpu_package=T
|
|
|
|
|
IF "%PACKAGENAME%"=="Microsoft.ML.OnnxRuntime.Gpu.Windows" set gpu_package=T
|
|
|
|
|
IF %%gpu_package%%=="T" (
|
2021-08-12 20:21:29 +00:00
|
|
|
set TESTONGPU=ON
|
2023-12-22 08:57:16 +00:00
|
|
|
%dn% test -p:DefineConstants=USE_TENSORRT test\Microsoft.ML.OnnxRuntime.EndToEndTests\Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore --filter TensorRT
|
2021-08-19 00:26:34 +00:00
|
|
|
|
|
|
|
|
IF NOT errorlevel 0 (
|
|
|
|
|
@echo "Failed to build or execute the end-to-end test"
|
|
|
|
|
EXIT 1
|
|
|
|
|
)
|
|
|
|
|
|
2021-08-12 20:21:29 +00:00
|
|
|
%dn% test -p:DefineConstants=USE_CUDA test\Microsoft.ML.OnnxRuntime.EndToEndTests\Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore
|
|
|
|
|
) ELSE (
|
|
|
|
|
%dn% test test\Microsoft.ML.OnnxRuntime.EndToEndTests\Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore
|
|
|
|
|
)
|
2021-08-19 00:26:34 +00:00
|
|
|
|
2019-05-20 22:48:14 +00:00
|
|
|
IF NOT errorlevel 0 (
|
2018-12-27 23:22:46 +00:00
|
|
|
@echo "Failed to build or execute the end-to-end test"
|
2019-05-20 22:48:14 +00:00
|
|
|
EXIT 1
|
2019-03-20 17:37:09 +00:00
|
|
|
)
|