Skip to content

Use set on Windows, not export #116745

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,16 @@
Any settings in the project file could be replaced on Helix.
See also eng\testing\WasmRunnerTemplate.sh
-->
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
<SetScriptCommands Condition="'$(Scenario)' != '' and '$(ContinuousIntegrationBuild)' != 'true'" Include="export SCENARIO=$(Scenario)" />
<SetScriptCommands Condition="'$(JSEngine)' != ''" Include="export JS_ENGINE=--engine=$(JSEngine)" />
<SetScriptCommands Condition="'$(JSEngineArgs)' != ''" Include="export JS_ENGINE_ARGS=$(JSEngineArgs)" />
<SetScriptCommands Condition="'$(_WasmJSEnginePathForTests)' != ''" Include="export V8_PATH_FOR_TESTS=${V8_PATH_FOR_TESTS:=$(_WasmJSEnginePathForTests)}" />
<SetScriptCommands Condition="'$(_WasmMainJSFileName)' != ''" Include="export MAIN_JS=--js-file=$(_WasmMainJSFileName)" />
<ItemGroup>
<SetScriptCommands Condition="'$(Scenario)' != '' and '$(ContinuousIntegrationBuild)' != 'true'" Include="$(EnvVarCommand) &quot;SCENARIO=$(Scenario)&quot;" />
<SetScriptCommands Condition="'$(JSEngine)' != ''" Include="$(EnvVarCommand) &quot;JS_ENGINE=--engine^=$(JSEngine)&quot;" />
<SetScriptCommands Condition="'$(JSEngineArgs)' != ''" Include="$(EnvVarCommand) &quot;JS_ENGINE_ARGS=$(JSEngineArgs)&quot;" />
<SetScriptCommands Condition="'$(_WasmMainJSFileName)' != ''" Include="$(EnvVarCommand) &quot;MAIN_JS=--js-file^=$(_WasmMainJSFileName)&quot;" />
<!-- Workaround for https://github.com/dotnet/runtime/issues/74328 -->
<SetScriptCommands Condition="'$(BuildAOTTestsOnHelix)' == 'true'" Include="export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1" />
<SetScriptCommands Condition="'$(BuildAOTTestsOnHelix)' == 'true'" Include="$(EnvVarCommand) DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1" />
</ItemGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<SetScriptCommands Condition="'$(Scenario)' != '' and '$(ContinuousIntegrationBuild)' != 'true'" Include="set &quot;SCENARIO=$(Scenario)&quot;" />
<SetScriptCommands Condition="'$(JSEngine)' != ''" Include="set &quot;JS_ENGINE=--engine^=$(JSEngine)&quot;" />
<SetScriptCommands Condition="'$(JSEngineArgs)' != ''" Include="set &quot;JS_ENGINE_ARGS=$(JSEngineArgs)&quot;" />
<SetScriptCommands Condition="'$(_WasmMainJSFileName)' != ''" Include="set &quot;MAIN_JS=--js-file^=$(_WasmMainJSFileName)&quot;" />
<!-- Workaround for https://github.com/dotnet/runtime/issues/74328 -->
<SetScriptCommands Condition="'$(BuildAOTTestsOnHelix)' == 'true'" Include="set DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1" />
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
<SetScriptCommands Condition="'$(_WasmJSEnginePathForTests)' != ''" Include="$(EnvVarCommand) V8_PATH_FOR_TESTS=${V8_PATH_FOR_TESTS:=$(_WasmJSEnginePathForTests)}" />
</ItemGroup>

<PropertyGroup>
Expand Down Expand Up @@ -251,15 +245,10 @@
Text="Only supported scenarios are WasmTestOnV8, WasmTestOnChrome, WasmTestOnFirefox and BuildWasmApps at the moment. It was $(Scenario)." />

<!-- Restore NPM packages -->
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
<SetScriptCommands Condition="'$(InstallChromeForTests)' == 'true' and '$(ChromeDriverBinaryPath)' != ''" Include="export PREPEND_PATH=$([System.IO.Path]::GetDirectoryName($(ChromeDriverBinaryPath)))" />
<SetScriptCommands Condition="'$(InstallFirefoxForTests)' == 'true' and '$(GeckoDriverBinaryPath)' != ''" Include="export PREPEND_PATH=$([System.IO.Path]::GetDirectoryName($(GeckoDriverBinaryPath)))" />
<SetScriptCommands Condition="'$(IsBrowserWasmProject)' == 'true'" Include="export RuntimeIdentifier=browser-wasm" />
</ItemGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<SetScriptCommands Condition="'$(InstallChromeForTests)' == 'true' and '$(ChromeDriverBinaryPath)' != ''" Include="set PREPEND_PATH=$([System.IO.Path]::GetDirectoryName($(ChromeDriverBinaryPath)))" />
<SetScriptCommands Condition="'$(InstallFirefoxForTests)' == 'true' and '$(GeckoDriverBinaryPath)' != ''" Include="set PREPEND_PATH=$([System.IO.Path]::GetDirectoryName($(GeckoDriverBinaryPath)))" />
<SetScriptCommands Condition="'$(IsBrowserWasmProject)' == 'true'" Include="set RuntimeIdentifier=browser-wasm" />
<ItemGroup>
<SetScriptCommands Condition="'$(InstallChromeForTests)' == 'true' and '$(ChromeDriverBinaryPath)' != ''" Include="$(EnvVarCommand) PREPEND_PATH=$([System.IO.Path]::GetDirectoryName($(ChromeDriverBinaryPath)))" />
<SetScriptCommands Condition="'$(InstallFirefoxForTests)' == 'true' and '$(GeckoDriverBinaryPath)' != ''" Include="$(EnvVarCommand) PREPEND_PATH=$([System.IO.Path]::GetDirectoryName($(GeckoDriverBinaryPath)))" />
<SetScriptCommands Condition="'$(IsBrowserWasmProject)' == 'true'" Include="$(EnvVarCommand) RuntimeIdentifier=browser-wasm" />
</ItemGroup>
</Target>
</Project>
7 changes: 5 additions & 2 deletions eng/testing/tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<ILLinkDescriptorsPath>$(MSBuildThisFileDirectory)ILLinkDescriptors\</ILLinkDescriptorsPath>
<TestSingleFile Condition="'$(TestNativeAot)' == 'true'">true</TestSingleFile>
<TestSingleFile Condition="'$(TestReadyToRun)' == 'true'">true</TestSingleFile>
<EnvVarCommand Condition="'$(OS)' == 'Windows_NT' or '$(TargetsWindows)' == 'true' or '$(TargetPlatformIdentifier)' == 'windows'">set</EnvVarCommand>
<EnvVarCommand Condition="'$(OS)' != 'Windows_NT' and '$(TargetsWindows)' != 'true' and '$(TargetPlatformIdentifier)' != 'windows'">export</EnvVarCommand>
<DirSeparator Condition="'$(OS)' == 'Windows_NT'">\\</DirSeparator>
<DirSeparator Condition="'$(OS)' != 'Windows_NT'">/</DirSeparator>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetsMobile)' == 'true'">
Expand All @@ -27,8 +31,7 @@

<!-- Provide runtime options to Mono (interpreter, aot, debugging, etc) -->
<ItemGroup Condition="'$(MonoEnvOptions)' != '' and '$(TargetsMobile)' != 'true'">
<RunScriptCommands Condition="'$(TargetsWindows)' == 'true' or '$(TargetPlatformIdentifier)' == 'windows'" Include="set MONO_ENV_OPTIONS='$(MonoEnvOptions)'" />
<RunScriptCommands Condition="'$(TargetsWindows)' != 'true' and '$(TargetPlatformIdentifier)' != 'windows'" Include="export MONO_ENV_OPTIONS='$(MonoEnvOptions)'" />
<RunScriptCommands Include="$(EnvVarCommand) MONO_ENV_OPTIONS='$(MonoEnvOptions)'" />
</ItemGroup>

<ItemGroup Condition="'$(TestRunRequiresLiveRefPack)' == 'true'">
Expand Down
3 changes: 1 addition & 2 deletions eng/testing/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
<ItemGroup Condition="'$(IsXUnitLogCheckerSupported)' == 'true' and
'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '$(NETCoreAppCurrentVersion)'))">
<SetScriptCommands Condition="'$(TargetOS)' == 'windows'" Include="set __IsXUnitLogCheckerSupported=1" />
<SetScriptCommands Condition="'$(TargetOS)' != 'windows'" Include="export __IsXUnitLogCheckerSupported=1" />
<SetScriptCommands Include="$(EnvVarCommand) __IsXUnitLogCheckerSupported=1" />
</ItemGroup>

<!-- Archive test binaries. -->
Expand Down
10 changes: 3 additions & 7 deletions eng/testing/tests.wasi.targets
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,9 @@
'$(Scenario)' != 'BuildWasmApps'"
Text="Only supported scenarios are WasmTestOnWasmtime and BuildWasmApps at the moment. It was $(Scenario)." />

<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
<SetScriptCommands Condition="'$(InstallWasmtimeForTests)' == 'true' and Exists($(WasmtimeDir))" Include="export PREPEND_PATH=$(WasmtimeDir)" />
<SetScriptCommands Condition="'$(IsWasiProject)' == 'true'" Include="export RuntimeIdentifier=wasi-wasm" />
</ItemGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<SetScriptCommands Condition="'$(InstallWasmtimeForTests)' == 'true' and Exists($(WasmtimeDir))" Include="set PREPEND_PATH=$(WasmtimeDir)" />
<SetScriptCommands Condition="'$(IsWasiProject)' == 'true'" Include="set RuntimeIdentifier=wasi-wasm" />
<ItemGroup >
<SetScriptCommands Condition="'$(InstallWasmtimeForTests)' == 'true' and Exists($(WasmtimeDir))" Include="$(EnvVarCommand) PREPEND_PATH=$(WasmtimeDir)" />
<SetScriptCommands Condition="'$(IsWasiProject)' == 'true'" Include="$(EnvVarCommand) RuntimeIdentifier=wasi-wasm" />
</ItemGroup>
</Target>
</Project>
3 changes: 1 addition & 2 deletions eng/testing/xunit/xunit.console.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

<ItemGroup>
<!-- Configures xunit to not print out passing tests with output when diagnostic messages are enabled. -->
<SetScriptCommands Condition="'$(TargetOS)' == 'windows'" Include="set XUNIT_HIDE_PASSING_OUTPUT_DIAGNOSTICS=1" />
<SetScriptCommands Condition="'$(TargetOS)' != 'windows'" Include="export XUNIT_HIDE_PASSING_OUTPUT_DIAGNOSTICS=1" />
<SetScriptCommands Include="$(EnvVarCommand) XUNIT_HIDE_PASSING_OUTPUT_DIAGNOSTICS=1" />
</ItemGroup>

<PropertyGroup Condition="'$(BundleXunitRunner)' == 'true'">
Expand Down
Loading