diff options
author | Tlakaelel Axayakatl Ceja <tlakaelel.ceja@microsoft.com> | 2022-10-06 22:25:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 22:25:27 +0300 |
commit | a12da51e26be8df07e43a09bc56dc4db85df6204 (patch) | |
tree | 053a40c2d667c61623addf0258f0b903ac3a6939 /Test | |
parent | 1a88006d339e21a684b28efc62fe7b587b464fc3 (diff) |
Add arcade infrastructure to dotnet/cecil (#37)
Add arcade infrastructure to dotnet/cecil
Adds eng/common folder from arcade
Adds NuGet.config file with the dotnet eng/tools/public package sources
Adds build scripts at root level to execute the eng/common/build scripts
Adds eng/Versions.props and eng/Version.Details.xml files with minimal dependencies since Cecil doesn't require anything, mostly just setting up the package version
Adds global.json
Adds arcade artifacts to .gitignore file
Add Microsoft.Dotnet.Arcade.Sdk
Make Mono.Cecil a package
Remove frameworks non-compatible with Arcade SDK
Make the package non-shippable so it doesn't publish in Nuget
Suppress license validation since Cecil has a different license than MIT one
Workaround the publickey and publickey token generation from arcade
Modify version to match Cecil version 0.11.4.0
Remove helix SDK since we don't use helix testing
Add pipeline yaml file
Add support for NetCoreAppToolCurrent equals to net7.0 and ToolsFramework netstandard 2.0
Add a variable to find the resources folder given that there is a new structure in the artifacts directory
Use VS test runner to avoid running tests using xunit
Add signing properties for 3rd party libraries
Diffstat (limited to 'Test')
-rw-r--r-- | Test/Mono.Cecil.Tests.csproj | 11 | ||||
-rw-r--r-- | Test/Mono.Cecil.Tests/BaseTestFixture.cs | 10 |
2 files changed, 10 insertions, 11 deletions
diff --git a/Test/Mono.Cecil.Tests.csproj b/Test/Mono.Cecil.Tests.csproj index f7762e3..2383bc2 100644 --- a/Test/Mono.Cecil.Tests.csproj +++ b/Test/Mono.Cecil.Tests.csproj @@ -1,9 +1,9 @@ -<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current"> +<Project Sdk="Microsoft.NET.Sdk"> <Import Project="..\Mono.Cecil.Tests.props" /> <PropertyGroup> - <TargetFrameworks>netcoreapp3.1;net40</TargetFrameworks> + <TargetFramework>$(NetCoreAppTestsCurrent)</TargetFramework> </PropertyGroup> - <ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' "> + <ItemGroup Condition=" '$(TargetFramework)' == '$(NetCoreAppTestsCurrent)' "> <PackageReference Include="Microsoft.CodeAnalysis.CSharp"> <Version>2.10.0</Version> </PackageReference> @@ -26,4 +26,9 @@ <ItemGroup> <None Include="Resources\**\*" /> </ItemGroup> + <ItemGroup> + <RuntimeHostConfigurationOption Include="Mono.Cecil.ResourcesDirectory"> + <Value>$(MSBuildThisFileDirectory)Resources</Value> + </RuntimeHostConfigurationOption> + </ItemGroup> </Project> diff --git a/Test/Mono.Cecil.Tests/BaseTestFixture.cs b/Test/Mono.Cecil.Tests/BaseTestFixture.cs index 046791b..6504249 100644 --- a/Test/Mono.Cecil.Tests/BaseTestFixture.cs +++ b/Test/Mono.Cecil.Tests/BaseTestFixture.cs @@ -99,14 +99,8 @@ namespace Mono.Cecil.Tests { public static string FindResourcesDirectory (string sourceFilePath) { - var path = Path.GetDirectoryName (sourceFilePath); - while (!Directory.Exists (Path.Combine (path, "Resources"))) { - var old = path; - path = Path.GetDirectoryName (path); - Assert.AreNotEqual (old, path); - } - - return Path.Combine (path, "Resources"); + var resourcesDirectory = (string)AppContext.GetData ("Mono.Cecil.ResourcesDirectory")!; + return Path.GetFullPath (resourcesDirectory); } public static void AssertCode (string expected, MethodDefinition method) |