Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WASM] Fix v8 trimming tests on windows #53698

2 changes: 1 addition & 1 deletion eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
df -h
displayName: Disk Usage before Build

- ${{ if eq(parameters.nameSuffix, 'Browser_wasm_Windows') }}:
- ${{ if or(eq(parameters.nameSuffix, 'Browser_wasm_Windows'), eq(parameters.nameSuffix, 'Windows_Runtime_Release')) }}:
# Update machine certs
- task: PowerShell@2
displayName: Update machine certs
Expand Down
18 changes: 18 additions & 0 deletions eng/pipelines/runtime-linker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,21 @@ jobs:
extraStepsTemplate: /eng/pipelines/libraries/execute-trimming-tests-steps.yml
extraStepsParameters:
extraTestArgs: '/p:WasmBuildNative=false'

#
# Build Release config vertical for Browser-wasm_win
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms:
- Browser_wasm_win
jobParameters:
testGroup: innerloop
timeoutInMinutes: 120
nameSuffix: Windows_Runtime_Release
buildArgs: -s mono+libs -c $(_BuildConfig) /p:WasmBuildNative=false
extraStepsTemplate: /eng/pipelines/libraries/execute-trimming-tests-steps.yml
extraStepsParameters:
extraTestArgs: '/p:WasmBuildNative=false'
3 changes: 2 additions & 1 deletion eng/testing/linker/trimmingTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
<TestConsoleAppSourceFiles>
<ProjectFile>%(ProjectDir)project.csproj</ProjectFile>
<TestCommand Condition="'$(TargetArchitecture)' != 'wasm' Or '$(TargetOs)' != 'browser'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '$(NetCoreAppCurrent)', '%(TestRuntimeIdentifier)', 'publish', 'project'))</TestCommand>
<TestCommand Condition="'$(TargetArchitecture)' == 'wasm' And '$(TargetOs)' == 'browser'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '$(NetCoreAppCurrent)', '%(TestRuntimeIdentifier)', 'AppBundle', 'run-v8.sh'))</TestCommand>
<TestCommand Condition="'$(TargetArchitecture)' == 'wasm' And '$(TargetOs)' == 'browser' And '$(OS)' != 'Windows_NT'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '$(NetCoreAppCurrent)', '%(TestRuntimeIdentifier)', 'AppBundle', 'run-v8.sh'))</TestCommand>
<TestCommand Condition="'$(TargetArchitecture)' == 'wasm' And '$(TargetOs)' == 'browser' And '$(OS)' == 'Windows_NT'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '$(NetCoreAppCurrent)', '%(TestRuntimeIdentifier)', 'AppBundle', 'run-v8.cmd'))</TestCommand>
<TestExecutionDirectory Condition="'$(TargetArchitecture)' != 'wasm' Or '$(TargetOs)' != 'browser'">$([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '$(NetCoreAppCurrent)', '%(TestRuntimeIdentifier)', 'publish'))</TestExecutionDirectory>
<TestExecutionDirectory Condition="'$(TargetArchitecture)' == 'wasm' And '$(TargetOs)' == 'browser'">$([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '$(NetCoreAppCurrent)', '%(TestRuntimeIdentifier)', 'AppBundle'))</TestExecutionDirectory>
</TestConsoleAppSourceFiles>
Expand Down
13 changes: 11 additions & 2 deletions src/mono/wasm/build/WasmApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,23 @@

<Target Name="_GenerateRunV8Script">
<PropertyGroup>
<WasmRunV8ScriptPath Condition="'$(WasmRunV8ScriptPath)' == ''">$(WasmAppDir)run-v8.sh</WasmRunV8ScriptPath>
<WasmRunV8ScriptPath Condition="'$(WasmRunV8ScriptPath)' == '' and '$(OS)' != 'Windows_NT'">$(WasmAppDir)run-v8.sh</WasmRunV8ScriptPath>
<WasmRunV8ScriptPath Condition="'$(WasmRunV8ScriptPath)' == '' and '$(OS)' == 'Windows_NT'">$(WasmAppDir)run-v8.cmd</WasmRunV8ScriptPath>
</PropertyGroup>

<Error Condition="'$(WasmMainAssemblyFileName)' == ''" Text="%24(WasmMainAssemblyFileName) property needs to be set for generating $(WasmRunV8ScriptPath)." />
<WriteLinesToFile
File="$(WasmRunV8ScriptPath)"
Lines="v8 --expose_wasm runtime.js -- ${RUNTIME_ARGS} --run $(WasmMainAssemblyFileName) $*"
Overwrite="true">
Overwrite="true"
Condition="'$(OS)' != 'Windows_NT'">
</WriteLinesToFile>

<WriteLinesToFile
File="$(WasmRunV8ScriptPath)"
Lines="v8 --expose_wasm runtime.js -- %RUNTIME_ARGS% --run $(WasmMainAssemblyFileName) %*"
Overwrite="true"
Condition="'$(OS)' == 'Windows_NT'">
</WriteLinesToFile>

<ItemGroup>
Expand Down