Skip to content
Merged
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
13 changes: 7 additions & 6 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,10 @@ Fix steps:
}

try {
# Relative paths do not work well if cwd is not changed to project
Push-Location $Options.Top

if ($Options.Runtime -notlike 'fxdependent*') {
# Relative paths do not work well if cwd is not changed to project
Push-Location $Options.Top

if ($Options.Runtime -like 'win-arm*') {
$Arguments += "/property:SDKToUse=Microsoft.NET.Sdk"
} else {
Expand All @@ -410,7 +409,6 @@ Fix steps:
Start-CrossGen -PublishPath $publishPath -Runtime $script:Options.Runtime
Write-Log "pwsh.exe with ngen binaries is available at: $($Options.Output)"
}

} else {
$globalToolSrcFolder = Resolve-Path (Join-Path $Options.Top "../Microsoft.PowerShell.GlobalTool.Shim") | Select-Object -ExpandProperty Path

Expand All @@ -420,8 +418,6 @@ Fix steps:
$Arguments += "/property:SDKToUse=Microsoft.NET.Sdk.WindowsDesktop"
}

# Relative paths do not work well if cwd is not changed to project
Push-Location $Options.Top
Write-Log "Run dotnet $Arguments from $pwd"
Start-NativeExecution { dotnet $Arguments }
Write-Log "PowerShell output: $($Options.Output)"
Expand All @@ -440,6 +436,11 @@ Fix steps:
Pop-Location
}

# No extra post-building task will run if '-SMAOnly' is specified, because its purpose is for a quick update of S.M.A.dll after full build.
if ($SMAOnly) {
return
}

# publish reference assemblies
try {
Push-Location "$PSScriptRoot/src/TypeCatalogGen"
Expand Down
21 changes: 8 additions & 13 deletions test/xUnit/csharp/test_SecuritySupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,14 @@ public static class SecuritySupportTests
[Fact]
public static void TestScanContent()
{
Assert.Equal(AmsiUtils.AmsiNativeMethods.AMSI_RESULT.AMSI_RESULT_NOT_DETECTED, AmsiUtils.ScanContent(string.Empty, string.Empty));
}

[Fact]
public static void TestCloseSession()
{
AmsiUtils.CloseSession();
}

[Fact]
public static void TestUninitialize()
{
AmsiUtils.Uninitialize();
try
{
Assert.Equal(AmsiUtils.AmsiNativeMethods.AMSI_RESULT.AMSI_RESULT_NOT_DETECTED, AmsiUtils.ScanContent(string.Empty, string.Empty));
}
finally
{
AmsiUtils.Uninitialize();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Uninitialize calls CloseSession internally.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this explanation and why we combine the tests to the file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the explanation is needed here. It's more confusing as you won't see the original test cases anymore.

}
}
}
}