-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.cmd
More file actions
91 lines (79 loc) · 2.28 KB
/
test.cmd
File metadata and controls
91 lines (79 loc) · 2.28 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@echo off
REM Simple test runner wrapper for CloudNimble.DotNetDocs
REM Usage: test [options]
REM Examples:
REM test - Run all Core tests
REM test -failed - Show only failed tests
REM test DocNamespace - Run tests with DocNamespace in the name
REM test -list - List all tests
REM test -all - Run all test projects
setlocal enabledelayedexpansion
set FILTER=
set PROJECT=Core
set CONFIG=Debug
set EXTRA_ARGS=
set FAILED_ONLY=
:parse_args
if "%~1"=="" goto run_tests
if /i "%~1"=="-failed" (
set FAILED_ONLY=-FailedOnly
shift
goto parse_args
)
if /i "%~1"=="-all" (
set PROJECT=All
shift
goto parse_args
)
if /i "%~1"=="-list" (
set EXTRA_ARGS=-List
shift
goto parse_args
)
if /i "%~1"=="-release" (
set CONFIG=Release
shift
goto parse_args
)
if /i "%~1"=="-nobuild" (
set EXTRA_ARGS=!EXTRA_ARGS! -NoBuild
shift
goto parse_args
)
if /i "%~1"=="-help" (
echo CloudNimble.DotNetDocs Test Runner
echo.
echo Usage: test [filter] [options]
echo.
echo Options:
echo -failed Show only failed test output
echo -all Run all test projects
echo -list List tests without running
echo -release Use Release configuration
echo -nobuild Skip building before tests
echo -help Show this help
echo.
echo Examples:
echo test Run all Core tests
echo test DocNamespace Run tests matching "DocNamespace"
echo test -failed Show only failed tests
echo test -all -failed Run all projects, show only failures
goto :eof
)
REM Assume anything else is a filter
set FILTER=%~1
shift
goto parse_args
:run_tests
if not "%FILTER%"=="" (
REM Try to determine the best filter format
REM If it contains =, assume it's already a proper filter
echo %FILTER% | findstr /C:"=" >nul
if errorlevel 1 (
REM No = found, so create a filter
REM Check if it looks like a test method name or class name
set FILTER=FullyQualifiedName~%FILTER%
)
)
powershell -ExecutionPolicy Bypass -File "%~dp0run-tests.ps1" -Project %PROJECT% -Configuration %CONFIG% -Filter "%FILTER%" %FAILED_ONLY% %EXTRA_ARGS%
exit /b %ERRORLEVEL%