51 lines
1.7 KiB
Batchfile
51 lines
1.7 KiB
Batchfile
@echo off
|
|
setlocal
|
|
|
|
echo Building NavisworksTransport.UnitTests...
|
|
|
|
set MSBUILD_PATH="C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
|
|
if not exist %MSBUILD_PATH% (
|
|
set MSBUILD_PATH="C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe"
|
|
)
|
|
if not exist %MSBUILD_PATH% (
|
|
echo MSBuild not found. Please install Visual Studio 2022 or Build Tools.
|
|
exit /b 1
|
|
)
|
|
|
|
set VSTEST_PATH="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\TestPlatform\vstest.console.exe"
|
|
if not exist %VSTEST_PATH% (
|
|
set VSTEST_PATH="C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\TestPlatform\vstest.console.exe"
|
|
)
|
|
if not exist %VSTEST_PATH% (
|
|
echo vstest.console.exe not found. Please install Visual Studio 2022 test tools.
|
|
exit /b 1
|
|
)
|
|
|
|
set TEST_ADAPTER_PATH="packages\MSTest.TestAdapter.3.0.4\build\net462"
|
|
if not exist %TEST_ADAPTER_PATH% (
|
|
echo MSTest adapter path not found: %TEST_ADAPTER_PATH%
|
|
exit /b 1
|
|
)
|
|
|
|
set NAVISWORKS_PATH=C:\Program Files\Autodesk\Navisworks Manage 2026
|
|
if not exist "%NAVISWORKS_PATH%\Autodesk.Navisworks.Api.dll" (
|
|
echo Navisworks API path not found: %NAVISWORKS_PATH%
|
|
exit /b 1
|
|
)
|
|
|
|
set PATH=%NAVISWORKS_PATH%;%PATH%
|
|
|
|
%MSBUILD_PATH% "NavisworksTransport.UnitTests.csproj" /p:Configuration=Release /p:Platform=x64 /verbosity:minimal
|
|
if errorlevel 1 (
|
|
echo Unit test build failed!
|
|
exit /b 1
|
|
)
|
|
|
|
%VSTEST_PATH% "bin\x64\Release\NavisworksTransport.UnitTests.dll" /Platform:x64 /TestAdapterPath:%TEST_ADAPTER_PATH% /TestCaseFilter:"TestCategory!=NavisworksIntegration"
|
|
if errorlevel 1 (
|
|
echo Unit tests failed!
|
|
exit /b 1
|
|
)
|
|
|
|
echo Unit tests passed!
|