54fa658e31
- FullCLR build is disabled in this change. - FullCLR build related functionalities in `build.psm1` and `AppVeyor.psm1` are disabled. They are not cleaned up from `build.psm1` and `AppVeyor.psm1` yet. We need to adopt .NET Core 2.0 to verify the portable module concept, and if that works well, we will remove the Windows PowerShell source code and clean up our scripts. - `dnxcore50` and `portable-net5+win8` target framework monikers are removed. - Dependency on `Microsoft.NETCore.Portable.Compatibility` is removed. It's not necessary, but it may come back when we work on supporting the `portable module`. Its necessity can be reviewed at that time. - I didn't spend the time to try building powershell in Visual Studio 2017. We should have a separate issue for that. It's tracked by #3400 The `TypeCatalogParser` project is replaced by a MSBuild target to gather the dependency information. Due to .NET Core SDK issue [#1021](https://github.com/dotnet/sdk/issues/1021), our meta-package project `Microsoft.PowerShell.SDK` starts to generate an empty assembly during the build and that results in an empty assembly `Microsoft.PowerShell.SDK.dll` appear in `publish` folder and in `.deps.json` file. We cannot simply remove the assembly because it's now part of the TPA, and removing it will cause powershell to crash at startup. We have to live with this empty assembly until that .NET Core SDK issue is fixed. It's tracked by #3401. |
||
---|---|---|
.. | ||
csharp.tests.csproj | ||
fixture_AssemblyLoadContext.cs | ||
README.md | ||
test_Binders.cs | ||
test_CorePsExtensions.cs | ||
test_CorePsPlatform.cs | ||
test_ExtensionMethods.cs | ||
test_FileSystemProvider.cs | ||
test_MshSnapinInfo.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.