Fix C# NuGet tests

This commit is contained in:
Aleksi Juvani 2017-04-07 17:39:11 +03:00
parent bd3c542d63
commit 3bdf746fcc
2 changed files with 7 additions and 22 deletions

View File

@ -136,7 +136,7 @@
-- DLLs to reference in the project file.
if prj.language == "C#" and not response.packageEntries then
p.error("NuGet package '%s' has no file listing (are you sure referenced a .NET package and not a native package?)", id)
p.error("NuGet package '%s' has no file listing. This package might be too old to be using this API or it's not a .NET Framework package at all.", id)
end
if prj.language == "C#" then

View File

@ -147,43 +147,28 @@
-- NuGet packages should get references.
--
function suite.nuGetPackages()
function suite.nuGetPackages_net45()
dotnetframework "4.5"
nuget { "Newtonsoft.Json:7.0.1" }
nuget { "Newtonsoft.Json:10.0.2" }
prepare()
test.capture [[
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net10\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net10\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net11\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net11\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net20\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net20\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net30\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net30\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net40\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
]]
end
--
-- NuGet packages shouldn't get HintPaths for .NET Framework
-- versions that the project doesn't support.
--
function suite.nuGetPackages_olderNET()
function suite.nuGetPackages_net30()
dotnetframework "3.0"
nuget { "Newtonsoft.Json:7.0.1" }
nuget { "Newtonsoft.Json:10.0.2" }
prepare()
test.capture [[
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net10\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net10\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net11\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net11\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net20\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net20\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('packages\Newtonsoft.Json.7.0.1\lib\net30\Newtonsoft.Json.dll')">packages\Newtonsoft.Json.7.0.1\lib\net30\Newtonsoft.Json.dll</HintPath>
<HintPath>packages\Newtonsoft.Json.10.0.2\lib\net20\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>