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
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<!-- This controls the version of the cecil package, or the version of cecil in the project graph
when we build the cecil submodule. The reference assembly package will depend on this version of cecil.
Keep this in sync with ProjectInfo.cs in the submodule. -->
<MonoCecilVersion>0.11.3</MonoCecilVersion>
<MonoCecilVersion>0.11.4</MonoCecilVersion>
<UseVSTestRunner>true</UseVSTestRunner>
</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions test/Mono.Linker.Tests/Mono.Linker.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants);DEBUG</DefineConstants>
</PropertyGroup>

<ItemGroup>
<!-- Used in testcase to check the cecil package version. -->
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
<_Parameter1>CecilPackageVersion</_Parameter1>
<_Parameter2>$(MonoCecilVersion)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
<Folder Include="TestCasesRunner\" />
Expand Down
27 changes: 27 additions & 0 deletions test/Mono.Linker.Tests/Tests/CecilVersionCheck.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Linq;
using System.Reflection;
using NUnit.Framework;

namespace Mono.Linker.Tests
{
[TestFixture]
public class CecilVersionCheck
{
[TestCase]
public void CecilPackageVersionMatchesAssemblyVersion ()
{
var thisAssembly = Assembly.GetExecutingAssembly ();
var cecilPackageVersion = thisAssembly
.GetCustomAttributes<AssemblyMetadataAttribute> ()
.Where (ca => ca.Key == "CecilPackageVersion")
.Single ().Value;
// Assume that the test assembly builds against the same cecil as the linker.
var cecilAssemblyVersion = thisAssembly
.GetReferencedAssemblies ()
.Where (an => an.Name == "Mono.Cecil")
.Single ().Version;
Assert.AreEqual (cecilPackageVersion, cecilAssemblyVersion.ToString (3));
}
}
}