Skip to content
Closed
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
19 changes: 19 additions & 0 deletions Microsoft.Dotnet.Wpf.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.28815.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Xaml", "src\Microsoft.DotNet.Wpf\src\System.Xaml\System.Xaml.csproj", "{9AC36357-34B7-40A1-95CA-FE9F46D089A7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Xaml.Tests", "src\Microsoft.DotNet.Wpf\test\System.Xaml\System.Xaml.Tests.csproj", "{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packaging", "packaging", "{0159B0F1-0626-4BED-8D1B-CBFF4F12C369}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.DotNet.Wpf.GitHub", "Microsoft.DotNet.Wpf.GitHub", "{BF20132A-191F-4D34-9A1B-831772A6DFCF}"
Expand Down Expand Up @@ -267,6 +269,22 @@ Global
{9AC36357-34B7-40A1-95CA-FE9F46D089A7}.Release|x64.Build.0 = Release|x64
{9AC36357-34B7-40A1-95CA-FE9F46D089A7}.Release|x86.ActiveCfg = Release|Any CPU
{9AC36357-34B7-40A1-95CA-FE9F46D089A7}.Release|x86.Build.0 = Release|Any CPU
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Debug|ARM64.ActiveCfg = Debug|ARM64
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Debug|ARM64.Build.0 = Debug|ARM64
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Debug|x64.ActiveCfg = Debug|x64
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Debug|x64.Build.0 = Debug|x64
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Debug|x86.ActiveCfg = Debug|Any CPU
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Debug|x86.Build.0 = Debug|Any CPU
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Release|Any CPU.Build.0 = Release|Any CPU
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Release|ARM64.ActiveCfg = Release|ARM64
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Release|ARM64.Build.0 = Release|ARM64
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Release|x64.ActiveCfg = Release|x64
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Release|x64.Build.0 = Release|x64
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Release|x86.ActiveCfg = Release|Any CPU
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9}.Release|x86.Build.0 = Release|Any CPU
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|ARM64.ActiveCfg = Debug|ARM64
Expand Down Expand Up @@ -1915,6 +1933,7 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7E836B3B-DCEA-42CB-8EFB-2CE2D8551FA9} = {B0EFDB12-C931-4E7F-A6C2-D4AC111D7EDF}
{9AC36357-34B7-40A1-95CA-FE9F46D089A7} = {2EE4A2DA-70B3-4767-9D18-618DA0FE3105}
{BF20132A-191F-4D34-9A1B-831772A6DFCF} = {0159B0F1-0626-4BED-8D1B-CBFF4F12C369}
{C847934A-828C-4EBB-A004-B0E97C8313F4} = {BF20132A-191F-4D34-9A1B-831772A6DFCF}
Expand Down
2 changes: 1 addition & 1 deletion eng/AfterSolutionBuild.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)WpfArcadeSdk\tools\RunDrtsLocal.targets" Condition="'$(Test)'=='True'" />
<!-- <Import Project="$(MSBuildThisFileDirectory)WpfArcadeSdk\tools\RunDrtsLocal.targets" Condition="'$(Test)'=='True'" /> -->
</Project>
13 changes: 13 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@
<StrawberryPerlVersion>5.28.1.1-1</StrawberryPerlVersion>
<NetFramework48RefAssembliesVersion>0.0.0.1</NetFramework48RefAssembliesVersion>
</PropertyGroup>
<!-- Test related -->
<PropertyGroup>
<MoqPackageVersion>4.10.0</MoqPackageVersion>
</PropertyGroup>
<!-- Code Coverage -->
<PropertyGroup>
<CoverletMSBuildPackageVersion>3.1.2</CoverletMSBuildPackageVersion>
<CodecovVersion>1.9.0</CodecovVersion>
<ReportGeneratorVersion>4.0.9</ReportGeneratorVersion>
</PropertyGroup>
<PropertyGroup>
<SystemReflectionEmitPackageVersion>4.3.0</SystemReflectionEmitPackageVersion>
</PropertyGroup>
<!-- External Analyzers -->
<PropertyGroup>
<MicrosoftCodeAnalysisNetAnalyzersVersion>7.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
Expand Down
6 changes: 3 additions & 3 deletions eng/WpfArcadeSdk/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Import Project="$(WpfArcadeSdkToolsDir)RuntimeFrameworkReference.targets"/>
<Import Project="$(WpfArcadeSdkToolsDir)InlineTasks.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)ShippingProjects.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)GenerateProgramFileForTests.targets" />
<!-- <Import Project="$(WpfArcadeSdkToolsDir)GenerateProgramFileForTests.targets" /> -->
<Import Project="$(WpfArcadeSdkToolsDir)Packaging.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)Publishing.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)ReferenceAssembly.targets"/>
Expand All @@ -21,8 +21,8 @@
<Import Project="$(WpfArcadeSdkToolsDir)CodeAnalysis.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)Wpf.Cpp.targets" Condition="'$(MSBuildProjectExtension)'=='.vcxproj'"/>
<Import Project="$(NoTargetsTargets)" Condition="'$(NoTargets)'=='true'"/>
<Import Project="$(WpfArcadeSdkToolsDir)TestProjects.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)CreateTestPayload.targets" Condition="'$(CreateTestPayload)'=='true'"/>
<!-- <Import Project="$(WpfArcadeSdkToolsDir)TestProjects.targets" /> -->
<!-- <Import Project="$(WpfArcadeSdkToolsDir)CreateTestPayload.targets" Condition="'$(CreateTestPayload)'=='true'"/> -->
<Import Project="$(WpfArcadeSdkToolsDir)GenApi.targets"/>

<!-- PresentationBuildTasks related targets files -->
Expand Down
2 changes: 1 addition & 1 deletion eng/common/CIBuild.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*"
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -sign -pack -publish -ci %*"
2 changes: 2 additions & 0 deletions eng/common/CIUnitTest.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -test -ci %*"
29 changes: 26 additions & 3 deletions eng/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,28 @@ jobs:
# (!_HelixPipeline) ||
# (_HelixPipeline && _PublicBuildPipeline && _ContinuousIntegrationTestsEnabled && _BuildConfig == Release)
condition: or(ne(variables['_HelixPipeline'], 'true'), and(eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true')))


- script: eng\common\ciunittest.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_PublishArgs)
$(_SignArgs)
$(_OfficialBuildIdArgs)
$(_PlatformArgs)
$(_InternalRuntimeDownloadArgs)
displayName: Windows Build / Publish
condition: and(or(ne(variables['_HelixPipeline'], 'true'), and(eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true'))), ne(variables['_Platform'], 'arm64'))

- task: PublishTestResults@2
displayName: Publish XUnit Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
mergeTestResults: true
continueOnError: true
condition: and(succeeded(), eq(variables['_BuildConfig'], 'Release'), ne(variables['_Platform'], 'arm64'))

- task: PowerShell@2
displayName: Install .NET Core
inputs:
Expand Down Expand Up @@ -284,5 +305,7 @@ jobs:
testResultsFormat: 'XUnit'
testResultsFiles: 'testResults.xml'
searchFolder: '$(System.DefaultWorkingDirectory)\Results\'
testRunTitle: 'CTP results'
condition: eq(variables['System.TeamProject'], 'public')
testRunTitle: 'Test results'
mergeTestResults: true
condition: eq(variables['System.TeamProject'], 'public')

2 changes: 1 addition & 1 deletion src/Microsoft.DotNet.Wpf/test/MultiTargeting.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Xunit;

namespace System.Xaml.Tests.Common
{
public class CustomNamespacePrefixLookup : INamespacePrefixLookup
{
#nullable enable
public string[]? ExpectedNamespaces { get; set; }
#nullable disable
public string[] Prefixes { get; set; }

private int CurrentIndex { get; set; }

public string LookupPrefix(string ns)
{
if (ExpectedNamespaces != null)
{
Assert.Equal(ExpectedNamespaces[CurrentIndex], ns);
}

return Prefixes[CurrentIndex++];
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Xunit;

namespace System.Xaml.Tests.Common
{
public class CustomServiceProvider : IServiceProvider
{
public object Service { get; set; }

public object GetService(Type serviceType) => Service;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.ComponentModel;
using Xunit;

namespace System.Xaml.Tests.Common
{
public class CustomTypeDescriptorContext : ITypeDescriptorContext
{
#nullable enable
public Type[]? ExpectedServiceTypes { get; set; }
#nullable disable

public object[] Services { get; set; }

private int CurrentIndex = 0;

public IContainer Container => throw new NotImplementedException();

public object Instance => throw new NotImplementedException();

public PropertyDescriptor PropertyDescriptor => throw new NotImplementedException();

public object GetService(Type serviceType)
{
if (ExpectedServiceTypes != null)
{
try
{
Assert.Equal(ExpectedServiceTypes[CurrentIndex], serviceType);
}
catch
{
Assert.Equal(0,1);
}
}

return Services[CurrentIndex++];
}

public void OnComponentChanged() => throw new NotImplementedException();

public bool OnComponentChanging() => throw new NotImplementedException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Xunit;

namespace System.Xaml.Tests.Common
{
public class CustomXamlNameProvider : IXamlNameProvider
{
public string NameResult { get; set; }

public string GetName(object value) => NameResult;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Xunit;

namespace System.Xaml.Tests.Common
{
public class CustomXamlNameResolver : IXamlNameResolver
{
public string ExpectedName { get; set; } = "name";
public bool ExpectedCanAssignDirectly { get; set; } = true;

public object ResolveResult { get; set; }
public object GetFixupTokenResult { get; set; }

public bool IsFixupTokenAvailable { get; }

public object Resolve(string name)
{
Assert.Equal(ExpectedName, name);
return ResolveResult;
}

public object Resolve(string name, out bool isFullyInitialized)
{
throw new NotImplementedException();
}

public object GetFixupToken(IEnumerable<string> names)
{
throw new NotImplementedException();
}

public object GetFixupToken(IEnumerable<string> names, bool canAssignDirectly)
{
Assert.Equal(new string[] { ExpectedName }, names);
Assert.Equal(ExpectedCanAssignDirectly, canAssignDirectly);
return GetFixupTokenResult;
}

public IEnumerable<KeyValuePair<string, object>> GetAllNamesAndValuesInScope()
{
throw new NotImplementedException();
}

public event EventHandler OnNameScopeInitializationComplete
{
add => throw new NotImplementedException();
remove => throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Xunit;

namespace System.Xaml.Tests.Common
{
public class CustomXamlNamespaceResolver : IXamlNamespaceResolver
{
#nullable enable
public string? ExpectedPrefix { get; set; }
#nullable disable
public string GetNamespaceResult { get; set; }
private int CurrentIndex { get; set; }

public string GetNamespace(string prefix)
{
if (ExpectedPrefix != null)
{
Assert.Equal(ExpectedPrefix, prefix);
}

return GetNamespaceResult;
}

public IEnumerable<NamespaceDeclaration> GetNamespacePrefixes()
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Windows.Markup;
using Xunit;

namespace System.Xaml.Tests.Common
{
public class CustomXamlTypeResolver : IXamlTypeResolver
{
#nullable enable
public string? ExpectedQualifiedTypeName { get; set; }
#nullable disable
public Type ResolveResult { get; set; }

public Type Resolve(string qualifiedTypeName)
{
if (ExpectedQualifiedTypeName != null)
{
Assert.Equal(ExpectedQualifiedTypeName, qualifiedTypeName);
}

return ResolveResult;
}
}
}
Loading