Skip to content

Commit

Permalink
[wasm] Fix debugger tests run on Windows (#79124)
Browse files Browse the repository at this point in the history
This broke recently:

```
  'C:\Program' is not recognized as an internal or external command,
  operable program or batch file.
D:\a\_work\1\s\src\mono\wasm\debugger\DebuggerTestSuite\DebuggerTestSuite.csproj(57,5): error MSB3073: The command "C:\Program Files\dotnet\dotnet.exe test --no-build -s D:\a\_work\1\s\artifacts\bin\DebuggerTestSuite\x64\Debug\.runsettings -t --nologo -v:q" exited with code 9009.
```

- this is breaking because we are running `src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj`
    `<Exec Command="$(DotNetTool) test ..." />`

  - and `DotNetTool` here is `c:\Program Files\dotnet\dotnet.exe`, and
    the shell command breaks because of the space.
  - this broke because recently we moved to building with `7.0.100`. And
    when the version used for building matches the version installed on
    the system, the system dotnet is used.
    - but when it doesn't, it gets installed in
      `</repo/checkout>/.dotnet/dotnet`
    - So, because of the recent update the path changed to `C:\Program files`,
      and broke the command.
    - The fix is to simply quote the path.
  • Loading branch information
radical authored Dec 2, 2022
1 parent be8d1d0 commit 9d7ffb5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
BeforeTargets="CopyTestZipForHelix"
DependsOnTargets="_GenerateRunSettingsFile">

<Exec Command="$(DotNetTool) test --no-build -s $(RunSettingsFilePath) -t --nologo -v:q" ConsoleToMSBuild="true">
<Exec Command="&quot;$(DotNetTool)&quot; test --no-build -s $(RunSettingsFilePath) -t --nologo -v:q" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" ItemName="_ListOfTestsLines" />
</Exec>

Expand Down

0 comments on commit 9d7ffb5

Please sign in to comment.