提交 ab1aeb30 编写于 作者: N Nick Craver

Backport xunit tests to non-DNX as well.

This allows full testing from both solutions, all green.

This includes nuget updates for the test libraries but explicitly
excludes the npgsql upgrade, since there are known 2.0 vs. 3.0 driver
issues. If we can assume everyone is able to upgrade - then we should
switch testing over. Alternatively, we need to test both. My preference
would be the former.
上级 79baeebf
......@@ -21,7 +21,7 @@
namespace SqlMapper
{
class PerformanceTests
public class PerformanceTests
{
class Test
{
......
......@@ -4,10 +4,16 @@
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Dynamic;
using System.Linq;
using Xunit;
#if EXTERNALS
using System.Data.Entity.Spatial;
using Microsoft.SqlServer.Types;
#endif
#if COREFX
using IDbCommand = System.Data.Common.DbCommand;
using IDbDataParameter = System.Data.Common.DbParameter;
......
......@@ -30,6 +30,7 @@
using System.Data.Entity.Spatial;
using Microsoft.SqlServer.Types;
using System.Data.SqlServerCe;
using SqlServerTypes;
#if POSTGRESQL
using Npgsql;
#endif
......@@ -72,6 +73,9 @@ public partial class Tests : IDisposable
public Tests()
{
connection = Program.GetOpenConnection();
#if EXTERNALS
Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
#endif
}
public void Dispose()
......@@ -2619,7 +2623,7 @@ public void Issue178_SqlServer()
}
}
#if EXTERNALS
[SkipTest]
//[Fact]
public void Issue178_Firebird() // we expect this to fail due to a bug in Firebird; a PR to fix it has been submitted
{
var cs = @"initial catalog=localhost:database;user id=SYSDBA;password=masterkey";
......
......@@ -41,6 +41,22 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.DNX.Tests\Assert.cs">
......@@ -56,6 +72,7 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET45\Dapper NET45.csproj">
......@@ -63,6 +80,9 @@
<Name>Dapper NET45</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="xunit" version="2.1.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
......@@ -15,6 +16,8 @@
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
......@@ -38,6 +41,9 @@
<Prefer32Bit>false</Prefer32Bit>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="BLToolkit.4">
<HintPath>bltoolkit\BLToolkit.4.dll</HintPath>
......@@ -50,13 +56,13 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=4.6.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.4.6.1.0\lib\net45\FirebirdSql.Data.FirebirdClient.dll</HintPath>
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=4.8.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.4.8.1.1\lib\net45\FirebirdSql.Data.FirebirdClient.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FSharp.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\FSharp.Core.4.0.0\lib\FSharp.Core.dll</HintPath>
<Reference Include="FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\FSharp.Core.4.0.0.1\lib\net40\FSharp.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FSharp.PowerPack, Version=4.0.0.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......@@ -162,6 +168,22 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.DNX.Tests\Assert.cs">
......@@ -176,6 +198,21 @@
<Compile Include="..\Dapper.DNX.Tests\Tests.cs">
<Link>Tests.cs</Link>
</Compile>
<Compile Include="..\Dapper.DNX.Tests\Tests.Constructors.cs">
<Link>Tests.Constructors.cs</Link>
</Compile>
<Compile Include="..\Dapper.DNX.Tests\Tests.Enums.cs">
<Link>Tests.Enums.cs</Link>
</Compile>
<Compile Include="..\Dapper.DNX.Tests\Tests.MultiMap.cs">
<Link>Tests.MultiMap.cs</Link>
</Compile>
<Compile Include="..\Dapper.DNX.Tests\Tests.Parameters.cs">
<Link>Tests.Parameters.cs</Link>
</Compile>
<Compile Include="..\Dapper.DNX.Tests\Tests.QueryMultiple.cs">
<Link>Tests.QueryMultiple.cs</Link>
</Compile>
<Compile Include="EntityFramework\EFContext.cs" />
<Compile Include="Linq2Sql\DataClasses.designer.cs">
<AutoGen>True</AutoGen>
......@@ -248,6 +285,7 @@
<ItemGroup>
<Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" />
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<None Include="Linq2Sql\DataClasses.dbml.layout">
......@@ -310,6 +348,12 @@
if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64"
xcopy /s /y "$(SolutionDir)packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64"</PostBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
......
......@@ -9,6 +9,9 @@ namespace SqlServerTypes
/// </summary>
internal class Utilities
{
private static object _nativeLoadLock = new object();
private static bool _nativeAssembliesLoaded = false;
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr LoadLibrary(string libname);
......@@ -21,12 +24,21 @@ internal class Utilities
/// </param>
public static void LoadNativeAssemblies(string rootApplicationPath)
{
var nativeBinaryPath = IntPtr.Size > 4
? Path.Combine(rootApplicationPath, @"SqlServerTypes\x64\")
: Path.Combine(rootApplicationPath, @"SqlServerTypes\x86\");
if (_nativeAssembliesLoaded)
return;
lock (_nativeLoadLock)
{
if (!_nativeAssembliesLoaded)
{
var nativeBinaryPath = IntPtr.Size > 4
? Path.Combine(rootApplicationPath, @"SqlServerTypes\x64\")
: Path.Combine(rootApplicationPath, @"SqlServerTypes\x86\");
LoadNativeAssembly(nativeBinaryPath, "msvcr100.dll");
LoadNativeAssembly(nativeBinaryPath, "SqlServerSpatial110.dll");
LoadNativeAssembly(nativeBinaryPath, "msvcr100.dll");
LoadNativeAssembly(nativeBinaryPath, "SqlServerSpatial110.dll");
_nativeAssembliesLoaded = true;
}
}
}
private static void LoadNativeAssembly(string nativeBinaryPath, string assemblyName)
......
......@@ -30,7 +30,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="FirebirdSql.Data.FirebirdClient" version="4.6.1.0" targetFramework="net45" />
<package id="FSharp.Core" version="4.0.0" targetFramework="net45" />
<package id="FirebirdSql.Data.FirebirdClient" version="4.8.1.1" targetFramework="net45" />
<package id="FSharp.Core" version="4.0.0.1" targetFramework="net45" />
<package id="FSPowerPack.Community" version="3.0.0.0" targetFramework="net45" />
<package id="FSPowerPack.Core.Community" version="3.0.0.0" targetFramework="net45" />
<package id="FSPowerPack.Linq.Community" version="3.0.0.0" targetFramework="net45" />
......@@ -13,4 +13,12 @@
<package id="Npgsql" version="2.2.5" targetFramework="net45" />
<package id="SqlServerCompact" version="4.0.8854.1" targetFramework="net45" />
<package id="Susanoo.Core" version="0.8.4.36" targetFramework="net45" />
<package id="xunit" version="2.1.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
<package id="xunit.runner.console" version="2.1.0" targetFramework="net45" />
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" />
</packages>
\ No newline at end of file
此差异已折叠。
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="xml" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="nuspec" ContentType="application/octet" /><Default Extension="dll" ContentType="application/octet" /><Default Extension="pdb" ContentType="application/octet" /><Default Extension="txt" ContentType="application/octet" /><Default Extension="transform" ContentType="application/octet" /><Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /></Types>
\ No newline at end of file
此差异已折叠。
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\_desktop\xunit.execution.desktop.dll">
<Link>xunit.execution.desktop.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\_desktop\xunit.execution.desktop.dll">
<Link>xunit.execution.desktop.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\_desktop\xunit.execution.desktop.dll">
<Link>xunit.execution.desktop.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
<TestRunner>
<FriendlyName>xUnit.net {0}.{1}.{2} build {3}</FriendlyName>
<AssemblyPath>xunit.runner.tdnet.dll</AssemblyPath>
<TypeName>Xunit.Runner.TdNet.TdNetRunner</TypeName>
</TestRunner>
\ No newline at end of file
<TestRunner>
<FriendlyName>xUnit.net {0}.{1}.{2} build {3}</FriendlyName>
<AssemblyPath>xunit.runner.tdnet.dll</AssemblyPath>
<TypeName>Xunit.Runner.TdNet.TdNetRunner</TypeName>
</TestRunner>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册