Skip to content

Commit

Permalink
Fix mono master build (#112)
Browse files Browse the repository at this point in the history
Properly use `nunit.framework.dll` from NuGet packages. Mono 4.9
changes `nunit.framework.dll` so that all types and members are
`[Obsolete(IsError=true)]`, i.e. referencing them results in e.g.:

	GrefsTest.cs(12,3): error CS0619: `NUnit.Framework.TestFixtureAttribute' is obsolete:
	`The NUnit framework shipped with Mono is deprecated and will be removed in a future release.
	It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or
	some other form of acquiring NUnit.'

Some project files were properly using the NuGet package, but not all
of them. Fix all of the project files so that the NuGet package's
`nunit.framework.dll` is correctly used.

Additionally, set `$(DebugType)` to `Full` in `TestJVM.csproj`, to
work around a [Roslyn bug][0].
 
[0]: https://bugzilla.xamarin.com/show_bug.cgi?id=51175
  • Loading branch information
akoeplinger authored and jonpryor committed Jan 3, 2017
1 parent 769f944 commit c73302c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\..\..\lib\NUnit-2.6.3\bin\nunit.framework.dll</HintPath>
<HintPath>..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<Package>nunit</Package>
<HintPath>..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
</ItemGroup>
Expand All @@ -54,4 +53,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\..\lib\NUnit-2.6.3\bin\nunit.framework.dll</HintPath>
<HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -62,4 +62,4 @@
<Name>TestJVM</Name>
</ProjectReference>
</ItemGroup>
</Project>
</Project>
3 changes: 2 additions & 1 deletion tests/TestJVM/TestJVM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<OutputPath>..\..\bin\TestDebug</OutputPath>
<ErrorReport>prompt</ErrorReport>
<DefineTrace>false</DefineTrace>
Expand All @@ -38,7 +39,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\..\..\lib\NUnit-2.6.3\bin\nunit.framework.dll</HintPath>
<HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
3 changes: 1 addition & 2 deletions tools/generator/Tests/generator-Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="nunit.framework">
<HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<Package>nunit</Package>
<HintPath>..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion tools/logcat-parse/Tests/LogcatParse-Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework" />
<Reference Include="nunit.framework">
<HintPath>..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="GrefsTest.cs" />
Expand Down

0 comments on commit c73302c

Please sign in to comment.