forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjenkins.testall.cmd
More file actions
129 lines (99 loc) · 4.33 KB
/
jenkins.testall.cmd
File metadata and controls
129 lines (99 loc) · 4.33 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------
:: ============================================================================
::
:: jenkins.testall.cmd
::
:: Runs tests for Jenkins continuous integration. This script is called from
:: the Jenkins CI build and it runs all tests for x86 and x64, debug and test
:: build configs.
::
:: Do not use this script to run all tests on your dev box.
:: - It will delete all your existing test logs
:: - It does not run the various flavors of the tests in parallel (though
:: this is not currently possible anyway because rl stages logs in a
:: common directory)
:: - It does nothing to provide useful output when there are failures, e.g.
:: they can be buried under thousands of lines of output from further
:: tests run.
:: - It cannot be cancelled without risk of polluting your command prompt
:: environment with environment variables that will make further calls to
:: runtests.cmd behave unexpectedly.
::
:: ============================================================================
@echo off
setlocal
set _RootDir=%~dp0..
set _BinDir=%_RootDir%\Build\VcBuild\bin
set _HadFailures=0
:: ============================================================================
:: Main script
:: ============================================================================
:main
if not "%JENKINS_BUILD%" == "True" (
echo This script should be run under a Jenkins Build environment
exit /b 2
)
pushd %_RootDir%\test
set _TestDir=%CD%
call jenkins.parsetestargs.cmd %*
call :doSilent rd /s/q %_TestDir%\logs
call :runTests x86debug
call :runTests x86test
call :runTests x64debug
call :runTests x64test
call :runNativeTests x86debug
call :runNativeTests x86test
call :runNativeTests x64debug
call :runNativeTests x64test
call :summarizeLogs
echo.
if "%_HadFailures%" == "1" (
echo -- jenkins.testall.cmd ^>^> Tests failed! 1>&2
) else (
echo -- jenkins.testall.cmd ^>^> Tests passed!
)
popd
exit /b %_HadFailures%
goto :eof
:: ============================================================================
:: Run one test suite against one build config and record if there were errors
:: ============================================================================
:runTests
call :do %_TestDir%\runtests.cmd -%1 -quiet -cleanupall -nottags exclude_jenkins %_ExtraTestArgs% -binDir %_BinDir%
if ERRORLEVEL 1 set _HadFailures=1
goto :eof
:: ============================================================================
:: Run jsrt test suite against one build config and record if there were errors
:: ============================================================================
:runNativeTests
call :do %_TestDir%\runnativetests.cmd -%1 -binDir %_BinDir% > %_LogDir%\nativetests.log 2>&1
if ERRORLEVEL 1 set _HadFailures=1
goto :eof
:: ============================================================================
:: Summarize the logs into a listing of only the failures
:: ============================================================================
:summarizeLogs
pushd %_TestDir%\logs
findstr /sp failed rl.results.log > summary.log
findstr /sip failed nativetests.log >> summary.log
rem Echo to stderr so that VSO includes the output in the build summary
type summary.log 1>&2
popd
:: ============================================================================
:: Echo a command line before executing it
:: ============================================================================
:do
echo -- jenkins.testall.cmd ^>^> %*
cmd /s /c "%*"
goto :eof
:: ============================================================================
:: Echo a command line before executing it and redirect the command's output
:: to nul
:: ============================================================================
:doSilent
echo -- jenkins.testall.cmd ^>^> %* ^> nul 2^>^&1
cmd /s /c "%* > nul 2>&1"
goto :eof