forked from microsoft/Recognizers-Text
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.ci.cmd
49 lines (37 loc) · 1.25 KB
/
tests.ci.cmd
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ECHO ==============================.NET TESTS START==============================
@ECHO off
SETLOCAL EnableDelayedExpansion
SET vswhere="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
for /f "usebackq tokens=*" %%i in (`!vswhere! -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
set VSInstallDir=%%i
)
set configuration=Release
ECHO.
ECHO # Finding VSTest
SET VSTestDir=%VSInstallDir%\Common7\IDE\CommonExtensions\Microsoft\TestWindow
IF NOT EXIST "%VSTestDir%\vstest.console.exe" (
ECHO "vstest.console.exe" could not be found at "%VSTestDir%"
EXIT /B
)
ECHO # Running .NET Tests
SET testcontainer=
FOR /R %%f IN (*Tests.dll) DO (
(ECHO "%%f" | FINDSTR /V "\bin\%configuration%" 1>NUL) || (
SET testcontainer=!testcontainer! "%%f"
)
)
ECHO "!VsTestDir!\vstest.console"
CALL "!VsTestDir!\vstest.console" /Logger:"console;verbosity=minimal" /Parallel %testcontainer%
IF %ERRORLEVEL% NEQ 0 GOTO TEST_ERROR
ECHO.
ECHO # Running CreateAllPackages.cmd
CALL CreateAllPackages.cmd
IF %ERRORLEVEL% NEQ 0 (
ECHO # Failed to create packages.
EXIT /b -1
)
EXIT /b 0
:TEST_ERROR
ECHO .NET Test failure(s) found!
EXIT /b 1
ECHO ============================== .NET TESTS END ==============================