Skip to content

Commit

Permalink
Unit tests runs on Linux. Update to latest nuget dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
J-M committed Mar 14, 2015
1 parent d77ed50 commit 9632951
Show file tree
Hide file tree
Showing 27 changed files with 128 additions and 152 deletions.
15 changes: 6 additions & 9 deletions R.NET/RDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0923E1A0-2032-4997-AB73-49E42C4034A9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
Expand Down Expand Up @@ -36,10 +34,6 @@
<DocumentationFile>bin\Release\RDotNet.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="DynamicInterop, Version=0.7.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\DynamicInterop.0.7.2.0\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
Expand All @@ -48,6 +42,9 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="DynamicInterop">
<HintPath>..\packages\DynamicInterop.0.7.4\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Closure.cs" />
Expand Down Expand Up @@ -134,9 +131,6 @@
<Name>RDotNet.NativeLibrary</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
Expand All @@ -156,4 +150,7 @@
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion R.NET/REngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected REngine(string id, string dll)
this.isRunning = false;
this.Disposed = false;
this.EnableLock = true; // See https://rdotnet.codeplex.com/workitem/113; it seems wise to enable it by default.
this.AutoPrint = false;
this.AutoPrint = true;
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions R.NET/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.2.0" targetFramework="net40" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.4" targetFramework="net40" />
</packages>
18 changes: 6 additions & 12 deletions RDotNet.Graphics.Tests/RDotNet.Graphics.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A535A809-9FA8-4167-8551-5AC84C7C4E1D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
Expand Down Expand Up @@ -32,14 +30,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="DynamicInterop, Version=0.7.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\DynamicInterop.0.7.2.0\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
Expand All @@ -49,6 +40,9 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="DynamicInterop">
<HintPath>..\packages\DynamicInterop.0.7.4\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="GraphForm.cs">
Expand Down Expand Up @@ -86,9 +80,6 @@
<DependentUpon>GraphForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand All @@ -98,4 +89,7 @@
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions RDotNet.Graphics.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.2.0" targetFramework="net40" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.4" targetFramework="net40" />
</packages>
15 changes: 6 additions & 9 deletions RDotNet.Graphics/RDotNet.Graphics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
Expand Down Expand Up @@ -35,10 +33,6 @@
<DocumentationFile>bin\Release\RDotNet.Graphics.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="DynamicInterop, Version=0.7.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\DynamicInterop.0.7.2.0\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
Expand All @@ -47,6 +41,9 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="DynamicInterop">
<HintPath>..\packages\DynamicInterop.0.7.4\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Color.cs" />
Expand Down Expand Up @@ -81,9 +78,6 @@
<Name>RDotNet.NativeLibrary</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand All @@ -99,4 +93,7 @@
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions RDotNet.Graphics/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.2.0" targetFramework="net40" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.4" targetFramework="net40" />
</packages>
15 changes: 6 additions & 9 deletions RDotNet.NativeLibrary/RDotNet.NativeLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2A089A59-0F22-4484-B442-0FE8BDA10879}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
Expand Down Expand Up @@ -35,17 +33,16 @@
<DocumentationFile>bin\Release\RDotNet.NativeLibrary.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="DynamicInterop, Version=0.7.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\DynamicInterop.0.7.2.0\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="DynamicInterop">
<HintPath>..\packages\DynamicInterop.0.7.4\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\R.NET\Properties\VersionInfo.cs">
Expand All @@ -54,9 +51,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="NativeUtility.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand All @@ -72,4 +66,7 @@
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions RDotNet.NativeLibrary/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.2.0" targetFramework="net40" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.4" targetFramework="net40" />
</packages>
10 changes: 5 additions & 5 deletions RDotNet.TestBase/RDotNet.TestBase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DynamicInterop, Version=0.7.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\DynamicInterop.0.7.2.0\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -45,8 +41,12 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="DynamicInterop">
<HintPath>..\packages\DynamicInterop.0.7.4\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<Compile Include="MockDevice.cs" />
Expand Down
24 changes: 23 additions & 1 deletion RDotNet.TestBase/RDotNetTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using RDotNet.NativeLibrary;
using System;
using System.Linq;
using System.Numerics;

namespace RDotNet
{
Expand Down Expand Up @@ -101,7 +102,28 @@ protected static void CheckArrayEqual<T>(T[] a, T[] expected)
{
Assert.AreEqual(expected.Length, a.Length);
for (int i = 0; i < a.Length; i++)
Assert.AreEqual(expected[i], a[i]); //, 1e-9);
AssertElementsAreEqual(expected[i], a[i]); //, 1e-9);
}

public static void AssertComplexAreEqual(Complex actual, Complex expected)
{
// TestCreateComplexValid test otherwise fails on Mono, for NA values for R complex vectors.
if (double.IsNaN(expected.Real))
Assert.True(double.IsNaN(actual.Real));
if (double.IsNaN(expected.Imaginary))
Assert.True(double.IsNaN(actual.Imaginary));
if (!double.IsNaN(expected.Real) && !double.IsNaN(expected.Imaginary))
Assert.AreEqual(expected, actual);
}

protected static void AssertElementsAreEqual<T>(T actual, T expected)
{
// Yuck, but
// TestCreateComplexValid test otherwise fails on Mono, for NA values for R complex vectors.
if (typeof(T) == typeof(Complex))
AssertComplexAreEqual((Complex)(object)actual, (Complex)(object)expected);
else
Assert.AreEqual(expected, actual);
}

// I thought NUnit was dealing with array equivalence. Cannot see here, so emulate.
Expand Down
4 changes: 2 additions & 2 deletions RDotNet.TestBase/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.2.0" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" />
<package id="DynamicInterop" version="0.7.4" targetFramework="net40" />
<package id="NUnit" version="2.6.4" targetFramework="net40" />
</packages>
3 changes: 0 additions & 3 deletions RDotNet.Tests.md.sln
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,9 @@ Global
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = TestApps\SimpleTest\SimpleTest.csproj
Policies = $0
$0.TextStylePolicy = $1
$1.FileWidth = 120
$1.TabWidth = 3
$1.IndentWidth = 3
$1.EolMarker = Windows
$1.inheritsSet = VisualStudio
$1.inheritsScope = text/plain
Expand Down
2 changes: 0 additions & 2 deletions RDotNet.Tests/DataConversionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ private static void CheckBothArrayConversions<T>(Vector<T> vec, T[] expected)
{
var a = vec.ToArray();
CheckArrayEqual(a, expected);
a = vec.ToArray();
CheckArrayEqual(a, expected);
}

[Test]
Expand Down
9 changes: 4 additions & 5 deletions RDotNet.Tests/RDotNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DynamicInterop, Version=0.7.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\DynamicInterop.0.7.2.0\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
Expand All @@ -44,7 +40,10 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="DynamicInterop">
<HintPath>..\packages\DynamicInterop.0.7.4\lib\net40\DynamicInterop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions RDotNet.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DynamicInterop" version="0.7.2.0" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" />
<package id="DynamicInterop" version="0.7.4" targetFramework="net40" />
<package id="NUnit" version="2.6.4" targetFramework="net40" />
</packages>
Loading

0 comments on commit 9632951

Please sign in to comment.