Skip to content

Commit 49b33c5

Browse files
committed
split out exe test
1 parent e9f649d commit 49b33c5

17 files changed

+133
-52
lines changed

AcceptanceTests/AcceptanceTests.csproj

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
<Link>Helpers\DirectoryHelper.cs</Link>
7070
</Compile>
7171
<Compile Include="CommitCountingRepoFixture.cs" />
72-
<Compile Include="ExecCmdLineArgumentTest.cs" />
7372
<Compile Include="GitFlow\BaseGitFlowRepositoryFixture.cs" />
7473
<Compile Include="GitFlow\DevelopScenarios.cs" />
7574
<Compile Include="GitFlow\MetaDataByCommitFixture.cs" />
@@ -78,33 +77,23 @@
7877
<Compile Include="GitHubFlow\OtherBranchTests.cs" />
7978
<Compile Include="GitHubFlow\ReleaseBranchTests.cs" />
8079
<Compile Include="Helpers\Constants.cs" />
81-
<Compile Include="Helpers\InProcessExecutionResults.cs" />
80+
<Compile Include="Helpers\NextVersionWriter.cs" />
8281
<Compile Include="ModuleInitializer.cs" />
83-
<Compile Include="PullRequestInTeamCityTest.cs" />
8482
<Compile Include="EmptyRepositoryFixture.cs" />
85-
<Compile Include="Helpers\ExecutionResults.cs" />
8683
<Compile Include="Helpers\GitHelper.cs" />
87-
<Compile Include="Helpers\GitVersionHelper.cs" />
8884
<Compile Include="Helpers\PathHelper.cs" />
89-
<Compile Include="Helpers\Scrubbers.cs" />
9085
<Compile Include="GitHubFlow\MasterTests.cs" />
91-
<Compile Include="MsBuildProjectArgTest.cs" />
9286
<Compile Include="ApprovalTestsConfig.cs" />
9387
<Compile Include="RepositoryFixtureBase.cs" />
9488
</ItemGroup>
9589
<ItemGroup>
9690
<None Include="packages.config" />
97-
<None Include="TestBuildFile.proj" />
9891
</ItemGroup>
9992
<ItemGroup>
10093
<ProjectReference Include="..\GitVersionCore\GitVersionCore.csproj">
10194
<Project>{f9741a0d-b9d7-4557-9a1c-a7252c1071f5}</Project>
10295
<Name>GitVersionCore</Name>
10396
</ProjectReference>
104-
<ProjectReference Include="..\GitVersionExe\GitVersionExe.csproj">
105-
<Project>{c3578a7b-09a6-4444-9383-0deafa4958bd}</Project>
106-
<Name>GitVersionExe</Name>
107-
</ProjectReference>
10897
</ItemGroup>
10998
<ItemGroup>
11099
<Content Include="FodyWeavers.xml" />

AcceptanceTests/GitHubFlow/OtherBranchTests.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
namespace GitHubFlowVersion.AcceptanceTests
22
{
3-
using GitVersion;
43
using global::AcceptanceTests;
54
using global::AcceptanceTests.Helpers;
65
using LibGit2Sharp;
7-
using Shouldly;
86
using Xunit;
97

108
public class OtherBranchTests
@@ -20,10 +18,7 @@ public void CanTakeVersionFromReleaseBranch()
2018
fixture.Repository.CreateBranch("alpha-2.0.0");
2119
fixture.Repository.Checkout("alpha-2.0.0");
2220

23-
var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath);
24-
25-
result.ExitCode.ShouldBe(0);
26-
result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("2.0.0-alpha.1+5");
21+
fixture.AssertFullSemver("2.0.0-alpha.1+5");
2722
}
2823
}
2924
}

AcceptanceTests/Helpers/InProcessExecutionResults.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace AcceptanceTests.Helpers
2+
{
3+
using System.IO;
4+
using LibGit2Sharp;
5+
6+
public static class NextVersionWriter
7+
{
8+
public static void AddNextVersionTxtFile(this IRepository repository, string version)
9+
{
10+
var nextVersionFile = Path.Combine(repository.Info.WorkingDirectory, "NextVersion.txt");
11+
File.WriteAllText(nextVersionFile, version);
12+
}
13+
}
14+
}

AcceptanceTests/Helpers/Scrubbers.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

GitVersion.sln

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.30324.0
4+
VisualStudioVersion = 12.0.30723.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersionExe", "GitVersionExe\GitVersionExe.csproj", "{C3578A7B-09A6-4444-9383-0DEAFA4958BD}"
77
EndProject
@@ -24,6 +24,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{38030E
2424
.nuget\packages.config = .nuget\packages.config
2525
EndProjectSection
2626
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersionExe.Tests", "GitVersionExe.Tests\GitVersionExe.Tests.csproj", "{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}"
28+
EndProject
2729
Global
2830
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2931
Debug|Any CPU = Debug|Any CPU
@@ -62,6 +64,12 @@ Global
6264
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
6365
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|Any CPU.Build.0 = Release|Any CPU
6466
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|x86.ActiveCfg = Release|Any CPU
67+
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68+
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
69+
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|x86.ActiveCfg = Debug|Any CPU
70+
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
71+
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|Any CPU.Build.0 = Release|Any CPU
72+
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|x86.ActiveCfg = Release|Any CPU
6573
EndGlobalSection
6674
GlobalSection(SolutionProperties) = preSolution
6775
HideSolutionNode = FALSE

GitVersionCore/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
[assembly: AssemblyFileVersion("1.0.0")]
88
[assembly: InternalsVisibleTo("Tests")]
99
[assembly: InternalsVisibleTo("GitVersion")]
10-
[assembly: InternalsVisibleTo("AcceptanceTests")]
10+
[assembly: InternalsVisibleTo("AcceptanceTests")]
11+
[assembly: InternalsVisibleTo("GitVersionExe.Tests")]
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>GitVersionExe.Tests</RootNamespace>
11+
<AssemblyName>GitVersionExe.Tests</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="ApprovalTests">
34+
<HintPath>..\packages\ApprovalTests.3.0.7\lib\net40\ApprovalTests.dll</HintPath>
35+
</Reference>
36+
<Reference Include="ApprovalUtilities">
37+
<HintPath>..\packages\ApprovalUtilities.3.0.7\lib\net35\ApprovalUtilities.dll</HintPath>
38+
</Reference>
39+
<Reference Include="LibGit2Sharp">
40+
<HintPath>..\packages\LibGit2Sharp.0.19.0.0\lib\net40\LibGit2Sharp.dll</HintPath>
41+
</Reference>
42+
<Reference Include="Shouldly">
43+
<HintPath>..\packages\Shouldly.2.2.0\lib\net40\Shouldly.dll</HintPath>
44+
</Reference>
45+
<Reference Include="System" />
46+
<Reference Include="System.Core" />
47+
<Reference Include="System.Web.Extensions" />
48+
<Reference Include="System.Xml.Linq" />
49+
<Reference Include="System.Data.DataSetExtensions" />
50+
<Reference Include="Microsoft.CSharp" />
51+
<Reference Include="System.Data" />
52+
<Reference Include="System.Xml" />
53+
<Reference Include="xunit">
54+
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
55+
</Reference>
56+
<Reference Include="xunit.extensions">
57+
<HintPath>..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll</HintPath>
58+
</Reference>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<ProjectReference Include="..\AcceptanceTests\AcceptanceTests.csproj">
62+
<Project>{BF905F84-382C-440D-92F5-C61108626D8D}</Project>
63+
<Name>AcceptanceTests</Name>
64+
</ProjectReference>
65+
<ProjectReference Include="..\GitVersionCore\GitVersionCore.csproj">
66+
<Project>{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}</Project>
67+
<Name>GitVersionCore</Name>
68+
</ProjectReference>
69+
<ProjectReference Include="..\GitVersionExe\GitVersionExe.csproj">
70+
<Project>{c3578a7b-09a6-4444-9383-0deafa4958bd}</Project>
71+
<Name>GitVersionExe</Name>
72+
</ProjectReference>
73+
</ItemGroup>
74+
<ItemGroup>
75+
<None Include="packages.config" />
76+
<None Include="TestBuildFile.proj" />
77+
</ItemGroup>
78+
<ItemGroup>
79+
<Compile Include="ExecCmdLineArgumentTest.cs" />
80+
<Compile Include="ExecutionResults.cs" />
81+
<Compile Include="GitVersionHelper.cs" />
82+
<Compile Include="MsBuildProjectArgTest.cs" />
83+
<Compile Include="PullRequestInTeamCityTest.cs" />
84+
</ItemGroup>
85+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
86+
<PropertyGroup>
87+
<PostBuildEvent>
88+
if not exist "$(TargetDir)NativeBinaries" md "$(TargetDir)NativeBinaries"
89+
if not exist "$(TargetDir)NativeBinaries\x86" md "$(TargetDir)NativeBinaries\x86"
90+
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp.0.19.0.0\lib\net40\NativeBinaries\x86\*.*" "$(TargetDir)NativeBinaries\x86"
91+
if not exist "$(TargetDir)NativeBinaries\amd64" md "$(TargetDir)NativeBinaries\amd64"
92+
xcopy /s /y /d "$(SolutionDir)packages\LibGit2Sharp.0.19.0.0\lib\net40\NativeBinaries\amd64\*.*" "$(TargetDir)NativeBinaries\amd64"</PostBuildEvent>
93+
</PropertyGroup>
94+
</Project>

GitVersionExe.Tests/packages.config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="ApprovalTests" version="3.0.7" targetFramework="net45" />
4+
<package id="ApprovalUtilities" version="3.0.7" targetFramework="net45" />
5+
<package id="LibGit2Sharp" version="0.19.0.0" targetFramework="net45" />
6+
<package id="Shouldly" version="2.2.0" targetFramework="net45" />
7+
<package id="xunit" version="1.9.2" targetFramework="net45" />
8+
<package id="xunit.extensions" version="1.9.2" targetFramework="net45" />
9+
</packages>

GitVersionExe/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
[assembly: AssemblyVersion("1.0.0")]
77
[assembly: AssemblyFileVersion("1.0.0")]
88
[assembly: InternalsVisibleTo("Tests")]
9-
[assembly: InternalsVisibleTo("AcceptanceTests")]
9+
[assembly: InternalsVisibleTo("AcceptanceTests")]
10+
[assembly: InternalsVisibleTo("GitVersionExe.Tests")]

Packages/repositories.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<repositories>
33
<repository path="..\AcceptanceTests\packages.config" />
44
<repository path="..\GitVersionCore\packages.config" />
5+
<repository path="..\GitVersionExe.Tests\packages.config" />
56
<repository path="..\GitVersionExe\packages.config" />
67
<repository path="..\GitVersionTask\packages.config" />
78
<repository path="..\Tests\packages.config" />

0 commit comments

Comments
 (0)