Skip to content

Commit 5dc3574

Browse files
committed
modify cli arguments
1 parent 418570a commit 5dc3574

File tree

4 files changed

+16
-25
lines changed

4 files changed

+16
-25
lines changed

eng/build.ps1

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Param(
33
[ValidateSet("x86","x64","arm","arm64")][string][Alias('a', "platform")]$architecture = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant(),
44
[ValidateSet("Debug","Release")][string][Alias('c')] $configuration = "Debug",
55
[string][Alias('v')] $verbosity = "minimal",
6-
[switch][Alias('wt')] $withtests,
7-
[switch][Alias('rt')] $runtests,
6+
[switch][Alias('t')] $test,
87
[switch] $installruntimes,
98
[switch] $privatebuild,
109
[switch] $ci,
1110
[switch][Alias('bl')]$binaryLog,
11+
[switch] $skiptest,
1212
[switch] $skipmanaged,
1313
[switch] $skipnative,
1414
[switch] $bundletools,
@@ -24,11 +24,6 @@ Param(
2424
Set-StrictMode -Version Latest
2525
$ErrorActionPreference = "Stop"
2626

27-
if ($runtests) {
28-
$skipmanaged = $true
29-
$skipnative = $true
30-
}
31-
3227
$crossbuild = $false
3328
if (($architecture -eq "arm") -or ($architecture -eq "arm64")) {
3429
$processor = @([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())
@@ -73,7 +68,7 @@ if (-not $skipnative) {
7368

7469
# Install sdk for building, restore and build managed components.
7570
if (-not $skipmanaged) {
76-
if ($withtests) {
71+
if (-not $skiptest) {
7772
$remainingargs = "/p:BuildTests=true " + $remainingargs
7873
}
7974

@@ -103,7 +98,7 @@ if ($installruntimes -or $privatebuild) {
10398
}
10499

105100
# Run the xunit tests
106-
if ($runtests) {
101+
if ($test) {
107102
if (-not $crossbuild) {
108103
if ($useCdac) {
109104
$env:SOS_TEST_CDAC="true"

eng/build.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ __SkipConfigure=0
2828
__SkipGenerateVersion=0
2929
__InstallRuntimes=0
3030
__PrivateBuild=0
31-
__BuildTests=0
32-
__RunTests=0
31+
__Test=0
32+
__TestBuild=1
3333
__UnprocessedBuildArgs=
3434
__UseCdac=0
3535
__LiveRuntimeDir=
@@ -102,14 +102,12 @@ handle_arguments() {
102102
__PrivateBuild=1
103103
;;
104104

105-
withtests|-withtests)
106-
__BuildTests=1
105+
test|-test)
106+
__Test=1
107107
;;
108108

109-
runtests|-runtests)
110-
__RunTests=1
111-
__NativeBuild=0
112-
__ManagedBuild=0
109+
skiptest|-skiptest)
110+
__TestBuild=0
113111
;;
114112

115113
usecdac|-usecdac)
@@ -227,7 +225,7 @@ if [[ "$__ManagedBuild" == 1 ]]; then
227225
# __CommonMSBuildArgs contains TargetOS property
228226
echo "Commencing managed build for $__BuildType in $__RootBinDir/bin"
229227

230-
if [[ "$__BuildTests" == 1 ]]; then
228+
if [[ "$__TestBuild" == 1 ]]; then
231229
__ManagedBuildArgs="$__ManagedBuildArgs /p:BuildTests=true"
232230
fi
233231

@@ -270,7 +268,7 @@ fi
270268
# Run xunit tests
271269
#
272270

273-
if [[ "$__RunTests" == 1 ]]; then
271+
if [[ "$__Test" == 1 ]]; then
274272
if [[ "$__CrossBuild" == 0 ]]; then
275273
if [[ -z "$LLDB_PATH" ]]; then
276274
check_version_exists() {

eng/pipelines/build.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ jobs:
130130
- _PhaseName: ${{ coalesce(parameters.name, parameters.osGroup) }}_${{ config.architecture }}_${{ config.configuration }}
131131
- _Pipeline_StreamDumpDir: $(Build.SourcesDirectory)/artifacts/tmp/${{ config.configuration }}/streams
132132

133-
- _BuildTestArgs: '-withtests'
134-
- _RunTestArgs: '-runtests'
133+
- _TestArgs: '-test'
135134
- _Cross: ''
136135

137136
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
@@ -143,10 +142,10 @@ jobs:
143142
'error, testOnly and buildOnly cannot be true at the same time': error
144143

145144
- ${{ if eq(parameters.testOnly, 'true') }}:
146-
- _BuildTestArgs: '-withtests -skipnative'
145+
- _BuildTestArgs: '-skipnative'
147146

148147
- ${{ if or(eq(parameters.buildOnly, 'true'), eq(parameters.isCodeQLRun, 'true')) }}:
149-
- _BuildTestArgs: ''
148+
- _BuildTestArgs: '-skiptest'
150149

151150
# For testing msrc's and service releases. The RuntimeSourceVersion is either "default" or the service release version to test
152151
- _InternalInstallArgs: ''

test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ while [[ -h $source ]]; do
1313
done
1414

1515
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
16-
"$scriptroot/eng/build.sh" -runtests $@
17-
16+
"$scriptroot/eng/build.sh" -test -skipmanaged -skipnative $@

0 commit comments

Comments
 (0)