Skip to content

Commit 3adb7af

Browse files
committed
NEW: TravisCI config file
1 parent 6886bdd commit 3adb7af

File tree

15 files changed

+196
-33
lines changed

15 files changed

+196
-33
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: csharp
2+
solution: cli-netlite.sln
3+
4+
services:
5+
- docker
6+
7+
install:
8+
- nuget restore cli-netlite.sln
9+
- nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner
10+
script:
11+
# https://docs.travis-ci.com/user/docker/
12+
- docker pull enkeys/alpine-openjdk-amq7-snapshot
13+
- docker run --rm -v`pwd`/scripts:/mnt -p 5672:5672 -p 61616:61616 --entrypoint ash enkeys/alpine-openjdk-amq7-snapshot /mnt/entrypoint.sh amq7-server &
14+
- sleep 10
15+
- xbuild /p:Configuration=TravisCI cli-netlite.sln
16+
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./ClientUnitTests/bin/Debug/ClientUnitTests.dll

CliNetliteInstaller/CliNetliteInstaller.wixproj

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,27 @@
3636
</ItemGroup>
3737
<ItemGroup>
3838
<Content Include="Lang\en-us\LICENSE.rtf" />
39+
<Content Include="packages.config" />
3940
</ItemGroup>
4041
<ItemGroup>
4142
<EmbeddedResource Include="Lang\en-us\Loc_en-us.wxl" />
4243
</ItemGroup>
44+
<PropertyGroup>
45+
<WixToolPath>$(SolutionDir)packages\WiX.Toolset.UnofficialFork.3.11.0\tools\wix\</WixToolPath>
46+
<WixTargetsPath>$(WixToolPath)wix.targets</WixTargetsPath>
47+
<WixTasksPath>$(WixToolPath)WixTasks.dll</WixTasksPath>
48+
</PropertyGroup>
4349
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
44-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
50+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
4551
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
4652
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
4753
</Target>
48-
<!--
49-
To modify your build process, add your task inside one of the targets below and uncomment it.
50-
Other similar extension points exist, see Wix.targets.
51-
<Target Name="BeforeBuild">
52-
</Target>
53-
<Target Name="AfterBuild">
54-
</Target>
54+
<!--
55+
To modify your build process, add your task inside one of the targets below and uncomment it.
56+
Other similar extension points exist, see Wix.targets.
57+
<Target Name="BeforeBuild">
58+
</Target>
59+
<Target Name="AfterBuild">
60+
</Target>
5561
-->
5662
</Project>

CliNetliteInstaller/packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="WiX.Toolset.UnofficialFork" version="3.11.0" />
4+
</packages>

ClientLib/ClientLib.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@
3434
<PropertyGroup>
3535
<StartupObject />
3636
</PropertyGroup>
37+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'TravisCI|AnyCPU'">
38+
<DebugSymbols>true</DebugSymbols>
39+
<OutputPath>bin\TravisCI\</OutputPath>
40+
<DefineConstants>DEBUG;TRACE</DefineConstants>
41+
<DebugType>full</DebugType>
42+
<PlatformTarget>AnyCPU</PlatformTarget>
43+
<ErrorReport>prompt</ErrorReport>
44+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
45+
</PropertyGroup>
3746
<ItemGroup>
3847
<Reference Include="Amqp.Net, Version=1.2.0.0, Culture=neutral, PublicKeyToken=905a7b1e6458e0c3, processorArchitecture=MSIL">
3948
<HintPath>..\packages\AMQPNetLite.1.2.3\lib\net45\Amqp.Net.dll</HintPath>

ClientUnitTests/BasicBinTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,46 @@
1515
*/
1616

1717
using System;
18-
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using NUnit.Framework;
1919

2020
namespace ClientUnitTests
2121
{
22-
[TestClass]
22+
[TestFixture]
2323
public class BasicBinTests
2424
{
2525
private ClientRunner clientRunner = new ClientRunner();
2626

27-
[TestMethod]
27+
[Test]
2828
public void TestTrySenderHelp()
2929
{
3030
Assert.AreEqual(0, this.clientRunner.RunSender("--help"));
3131
}
3232

33-
[TestMethod]
33+
[Test]
3434
public void TestTryReceiverHelp()
3535
{
3636
Assert.AreEqual(0, this.clientRunner.RunReceiver("--help"));
3737
}
3838

39-
[TestMethod]
39+
[Test]
4040
public void TestTryConnectorHelp()
4141
{
4242
Assert.AreEqual(0, this.clientRunner.RunConnector("--help"));
4343
}
4444

45-
[TestMethod]
45+
[Test]
4646
public void TestSenderWrongArgument()
4747
{
4848
Assert.AreEqual(2, this.clientRunner.RunSender("--foo"));
4949
}
5050

51-
[TestMethod]
51+
[Test]
5252
public void TestReceiverWrongArgument()
5353
{
5454
Assert.AreEqual(2, this.clientRunner.RunReceiver("--foo"));
5555
}
5656

57-
[TestMethod]
57+
[Test]
5858
public void TestConnectorWrongArgument()
5959
{
6060
Assert.AreEqual(2, this.clientRunner.RunConnector("--foo"));

ClientUnitTests/ClientRunner.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Diagnostics;
3+
using System.IO;
34

45
namespace ClientUnitTests
56
{
@@ -37,8 +38,8 @@ private String getPath(String client)
3738
{
3839
return System.IO.Path.Combine(new String[] {
3940
this.projectDir,
40-
client + "\\bin\\Debug",
41-
"cli-netlite-" + client + ".exe" });
41+
client + "/bin/Debug",
42+
"cli-netlite-" + client.ToLower() + ".exe" });
4243
}
4344

4445
/// <summary>
@@ -53,11 +54,11 @@ private int runClient(ClientType type, String args)
5354

5455
string client;
5556
if (type == ClientType.Sender)
56-
client = "sender";
57+
client = "Sender";
5758
else if (type == ClientType.Receiver)
58-
client = "receiver";
59+
client = "Receiver";
5960
else
60-
client = "connector";
61+
client = "Connector";
6162

6263
p.StartInfo.FileName = this.getPath(client);
6364
Console.WriteLine(p.StartInfo.FileName);

ClientUnitTests/ClientUnitTests.csproj

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
1717
<IsCodedUITest>False</IsCodedUITest>
1818
<TestProjectType>UnitTest</TestProjectType>
19+
<NuGetPackageImportStamp>
20+
</NuGetPackageImportStamp>
1921
</PropertyGroup>
2022
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2123
<DebugSymbols>true</DebugSymbols>
@@ -34,7 +36,19 @@
3436
<ErrorReport>prompt</ErrorReport>
3537
<WarningLevel>4</WarningLevel>
3638
</PropertyGroup>
39+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'TravisCI|AnyCPU'">
40+
<DebugSymbols>true</DebugSymbols>
41+
<OutputPath>bin\TravisCI\</OutputPath>
42+
<DefineConstants>DEBUG;TRACE</DefineConstants>
43+
<DebugType>full</DebugType>
44+
<PlatformTarget>AnyCPU</PlatformTarget>
45+
<ErrorReport>prompt</ErrorReport>
46+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
47+
</PropertyGroup>
3748
<ItemGroup>
49+
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
50+
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
51+
</Reference>
3852
<Reference Include="System" />
3953
</ItemGroup>
4054
<Choose>
@@ -43,11 +57,7 @@
4357
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
4458
</ItemGroup>
4559
</When>
46-
<Otherwise>
47-
<ItemGroup>
48-
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
49-
</ItemGroup>
50-
</Otherwise>
60+
<Otherwise />
5161
</Choose>
5262
<ItemGroup>
5363
<Compile Include="BasicBinTests.cs" />
@@ -61,6 +71,9 @@
6171
<Name>ClientLib</Name>
6272
</ProjectReference>
6373
</ItemGroup>
74+
<ItemGroup>
75+
<None Include="packages.config" />
76+
</ItemGroup>
6477
<Choose>
6578
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
6679
<ItemGroup>

ClientUnitTests/SendReceiveTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,29 @@
1515
*/
1616

1717
using System;
18-
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using NUnit.Framework;
1919

2020
namespace ClientUnitTests
2121
{
22-
[TestClass]
22+
[TestFixture]
2323
public class SendReceiveTests
2424
{
2525
ClientRunner clientRunner = new ClientRunner();
2626

27-
[TestMethod]
27+
[Test]
2828
public void TestSendMessage()
2929
{
3030
Assert.AreEqual(0, this.clientRunner.RunSender("--address send_example --count 1"));
3131
}
3232

33-
[TestMethod]
33+
[Test]
3434
public void TestSendReceiveMessage()
3535
{
3636
Assert.AreEqual(0, this.clientRunner.RunSender("--address send_receive_example --count 1"));
3737
Assert.AreEqual(0, this.clientRunner.RunReceiver("--address send_receive_example --count 1"));
3838
}
3939

40-
[TestMethod]
40+
[Test]
4141
public void TestConnectorClient()
4242
{
4343
Assert.AreEqual(0, this.clientRunner.RunConnector("--address connector_example --count 5 --timeout 5 --obj-ctrl CESR"));

ClientUnitTests/packages.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="NUnit" version="2.6.4" targetFramework="net45" />
4+
<package id="NUnit.Runners.Net4" version="2.6.4" targetFramework="net45" />
5+
<package id="NUnitTestAdapter" version="2.1.1" targetFramework="net45" />
6+
</packages>

Connector/Connector.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
<ErrorReport>prompt</ErrorReport>
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
34+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'TravisCI|AnyCPU'">
35+
<DebugSymbols>true</DebugSymbols>
36+
<OutputPath>bin\TravisCI\</OutputPath>
37+
<DefineConstants>DEBUG;TRACE</DefineConstants>
38+
<DebugType>full</DebugType>
39+
<PlatformTarget>AnyCPU</PlatformTarget>
40+
<ErrorReport>prompt</ErrorReport>
41+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
42+
<Prefer32Bit>true</Prefer32Bit>
43+
</PropertyGroup>
3444
<ItemGroup>
3545
<Reference Include="System" />
3646
<Reference Include="System.Core" />

0 commit comments

Comments
 (0)