You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there are no unit tests for the msbuild tasks in src/tasks. For wasm, there are some limited tests for PInvokeTableGenerator in src/mono/wasm/Wasm.Build.Tests, but these perform full builds which are not always necessary.
Instead, the msbuild tasks should have their own unit tests in src/tests which can be targeted, and much lighter to run.
essentially, the task classes will inherit from MSBuildTaskBase, their Execute methods become ExecuteTask, and have a ConfigureServices for dependencies like Log.
Add a product dependency on Microsoft.Arcade.Common in eng/Version.Details.xml
<PackageReference Include="Microsoft.Arcade.Common" Version="$(MicrosoftArcadeCommonVersion)" /> in the project
Currently, there are no unit tests for the msbuild tasks in
src/tasks
. For wasm, there are some limited tests forPInvokeTableGenerator
insrc/mono/wasm/Wasm.Build.Tests
, but these perform full builds which are not always necessary.Instead, the msbuild tasks should have their own unit tests in
src/tests
which can be targeted, and much lighter to run.these can be based on Arcade's
MSBuildTaskBase
- https://github.com/dotnet/arcade/blob/main/Documentation/Mechanics/MSBuildTaskDependencyInjection.mdMSBuildTaskBase
, theirExecute
methods becomeExecuteTask
, and have aConfigureServices
for dependencies likeLog
.Add a product dependency on
Microsoft.Arcade.Common
ineng/Version.Details.xml
<PackageReference Include="Microsoft.Arcade.Common" Version="$(MicrosoftArcadeCommonVersion)" />
in the projectThis should be enough to build the project
And a separate test project would use the same package, and add tests like https://github.com/dotnet/arcade/blob/main/Documentation/Mechanics/MSBuildTaskDependencyInjection.md#how-to-use-with-tests
Examples for tests to add:
ManagedToNativeGenerator
- tests for native libraries, and assembly names with special characters (an example issue: [wasm] Compilation with WasmBuildNative fails with dependency containing hyphen in the name #78992)SignatureMapper
inWasmAppBuilder
This should be applicable for mobile tasks too.
cc @maraf @ilonatommy @lewing @steveisok
The text was updated successfully, but these errors were encountered: