84344cbb32
* Build Update - Change `TargetFramework` to `netcoreapp2.1` and removed unnecessary `RuntimeFrameworkVersion` from `PowerShell.Common.props` - Update dotnet SDK to 2.1.300-rc1-008662 - Update `TypeGen` target in `Build.psm1` to work with 2.1 - Rename macOS runtime to `osx-x64` as the old build logic expects 10.12 and breaks running on 10.13 system. - Remove `PackageReference` to `System.Memory` as it's part of dotnetcore 2.1 - Update search for `crossgen` executable to find the matching version * Test Update - Update test tools `WebListener` to latest `asp.net core` - Marked `AuthHeader Redirect` tests as `Pending` due to change in CoreFX |
||
---|---|---|
.. | ||
csharp.tests.csproj | ||
README.md | ||
test_Binders.cs | ||
test_CorePsPlatform.cs | ||
test_ExtensionMethods.cs | ||
test_FileSystemProvider.cs | ||
test_MshSnapinInfo.cs | ||
test_PSConfiguration.cs | ||
test_PSVersionInfo.cs | ||
test_Runspace.cs | ||
test_SecuritySupport.cs | ||
test_SessionState.cs | ||
test_Utils.cs |
xUnit Tests
These tests are completely Linux specific.
Every test class must belong to
[Collection("AssemblyLoadContext")]
. This ensures that PowerShell's
AssemblyLoadContext is initialized before any other code is executed.
When this is not the case, late initialization fails with
System.InvalidOperationException : Binding model is already locked for the AppDomain and cannot be reset.
Having every class in the same collection is as close to an xUnit global init hook as can be done.
Running xUnit Tests
Go to the top level of the PowerShell repository and run:
Start-PSxUnit
inside a self-hosted copy of PowerShell.