forked from DbUp/DbUp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
928818c
commit e984fe1
Showing
30 changed files
with
1,856 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<ProjectConfiguration> | ||
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace> | ||
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing> | ||
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies> | ||
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking> | ||
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking> | ||
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely> | ||
<RunPreBuildEvents>false</RunPreBuildEvents> | ||
<RunPostBuildEvents>false</RunPostBuildEvents> | ||
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully> | ||
<InstrumentAssembly>true</InstrumentAssembly> | ||
<PreventSigningOfAssembly>false</PreventSigningOfAssembly> | ||
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> | ||
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> | ||
<DefaultTestTimeout>60000</DefaultTestTimeout> | ||
<UseBuildConfiguration /> | ||
<ProxyProcessPath /> | ||
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture> | ||
</ProjectConfiguration> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<ProjectConfiguration> | ||
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace> | ||
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing> | ||
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies> | ||
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking> | ||
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking> | ||
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely> | ||
<RunPreBuildEvents>false</RunPreBuildEvents> | ||
<RunPostBuildEvents>false</RunPostBuildEvents> | ||
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully> | ||
<InstrumentAssembly>true</InstrumentAssembly> | ||
<PreventSigningOfAssembly>false</PreventSigningOfAssembly> | ||
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> | ||
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> | ||
<DefaultTestTimeout>60000</DefaultTestTimeout> | ||
<UseBuildConfiguration /> | ||
<UseBuildPlatform /> | ||
<ProxyProcessPath /> | ||
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture> | ||
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState> | ||
<BuildProcessArchitecture>x86</BuildProcessArchitecture> | ||
</ProjectConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<ProjectConfiguration> | ||
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace> | ||
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing> | ||
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies> | ||
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking> | ||
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking> | ||
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely> | ||
<RunPreBuildEvents>false</RunPreBuildEvents> | ||
<RunPostBuildEvents>false</RunPostBuildEvents> | ||
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully> | ||
<InstrumentAssembly>true</InstrumentAssembly> | ||
<PreventSigningOfAssembly>false</PreventSigningOfAssembly> | ||
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> | ||
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> | ||
<DefaultTestTimeout>60000</DefaultTestTimeout> | ||
<UseBuildConfiguration /> | ||
<ProxyProcessPath /> | ||
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture> | ||
</ProjectConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using ApiApprover; | ||
using ApprovalTests.Reporters; | ||
using DbUp.Builder; | ||
using NUnit.Framework; | ||
|
||
namespace DbUp.Tests | ||
{ | ||
[TestFixture] | ||
[UseReporter(typeof(DiffReporter))] | ||
public class ApiTests | ||
{ | ||
[Test] | ||
public void dbup_has_no_public_api_changes() | ||
{ | ||
PublicApiApprover.ApprovePublicApi(typeof(SupportedDatabases).Assembly.Location); | ||
} | ||
|
||
[Test] | ||
public void dbup_firebird_has_no_public_api_changes() | ||
{ | ||
PublicApiApprover.ApprovePublicApi(typeof(FirebirdExtensions).Assembly.Location); | ||
} | ||
|
||
[Test] | ||
public void dbup_mysql_has_no_public_api_changes() | ||
{ | ||
PublicApiApprover.ApprovePublicApi(typeof(MySqlExtensions).Assembly.Location); | ||
} | ||
|
||
[Test] | ||
public void dbup_postgres_has_no_public_api_changes() | ||
{ | ||
PublicApiApprover.ApprovePublicApi(typeof(PostgresqlExtensions).Assembly.Location); | ||
} | ||
|
||
[Test] | ||
public void dbup_sqlce_has_no_public_api_changes() | ||
{ | ||
PublicApiApprover.ApprovePublicApi(typeof(SqlCeExtensions).Assembly.Location); | ||
} | ||
|
||
[Test] | ||
public void dbup_sqlite_has_no_public_api_changes() | ||
{ | ||
PublicApiApprover.ApprovePublicApi(typeof(SQLiteExtensions).Assembly.Location); | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/DbUp.Tests/App_Packages/ApiApprover.3.0.1/PublicApiApprover.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.IO; | ||
using ApprovalTests; | ||
using ApprovalTests.Namers; | ||
using Mono.Cecil; | ||
|
||
namespace ApiApprover | ||
{ | ||
public static class PublicApiApprover | ||
{ | ||
public static void ApprovePublicApi(string assemblyPath) | ||
{ | ||
var assemblyResolver = new DefaultAssemblyResolver(); | ||
assemblyResolver.AddSearchDirectory(Path.GetDirectoryName(assemblyPath)); | ||
|
||
var readSymbols = File.Exists(Path.ChangeExtension(assemblyPath, ".pdb")); | ||
var asm = AssemblyDefinition.ReadAssembly(assemblyPath, new ReaderParameters(ReadingMode.Deferred) | ||
{ | ||
ReadSymbols = readSymbols, | ||
AssemblyResolver = assemblyResolver, | ||
}); | ||
|
||
var publicApi = PublicApiGenerator.CreatePublicApiForAssembly(asm); | ||
var writer = new ApprovalTextWriter(publicApi, "cs"); | ||
var approvalNamer = new AssemblyPathNamer(assemblyPath); | ||
ApprovalTests.Approvals.Verify(writer, approvalNamer, ApprovalTests.Approvals.GetReporter()); | ||
} | ||
|
||
private class AssemblyPathNamer : UnitTestFrameworkNamer | ||
{ | ||
private readonly string name; | ||
|
||
public AssemblyPathNamer(string assemblyPath) | ||
{ | ||
name = Path.GetFileNameWithoutExtension(assemblyPath); | ||
} | ||
|
||
public override string Name | ||
{ | ||
get { return name; } | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.