Adds unit tests

This commit is contained in:
Cyberboss
2017-11-06 01:20:18 -05:00
parent 3c70e5dd60
commit 5bab8ecb9f
17 changed files with 1236 additions and 778 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ namespace TGServerService
/// </summary>
//tell javascriptserializer to ignore these fields
[ScriptIgnore]
const string JSONFilename = "Instance.json";
public const string JSONFilename = "Instance.json";
/// <summary>
/// The current version of the config
/// </summary>
+5 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.ServiceProcess;
namespace TGServerService
{
@@ -9,7 +10,10 @@ namespace TGServerService
/// <summary>
/// Entry point to the program
/// </summary>
static void Main() => Service.Launch();
static void Main() {
using (var S = new Service())
ServiceBase.Run(S);
}
/// <summary>
/// Copy a file from <paramref name="source"/> to <paramref name="dest"/>, but first ensure the destination directory exists
@@ -1,4 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@@ -14,3 +15,6 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f32eda25-0855-411c-af5e-f0d042917e2d")]
//allow the unit tester to peek inside us
[assembly: InternalsVisibleTo("TGServiceTests", AllInternalsVisible = true)]
+698 -696
View File
File diff suppressed because it is too large Load Diff
+36 -27
View File
@@ -26,7 +26,7 @@ namespace TGServiceInterface
/// </summary>
protected const int BaseIndex = 8;
/// <summary>
/// Set to <see langword="true"/> if a child constructor should use the baseInfo parameter of <see cref="ChatSetupInfo.ChatSetupInfo(ChatSetupInfo, int)"/> to initialize it's property fields, <see langword="false"/> otherwise
/// Set to <see langword="true"/> if a child constructor should use the baseInfo parameter of <see cref="ChatSetupInfo.ChatSetupInfo(ChatProvider, ChatSetupInfo, int)"/> to initialize it's property fields, <see langword="false"/> otherwise
/// </summary>
protected readonly bool InitializeFields;
@@ -34,14 +34,15 @@ namespace TGServiceInterface
/// Raw access to the underlying data
/// </summary>
[DataMember]
public IList<string> DataFields { get; protected set; }
public IList<string> DataFields { get; protected set; }
/// <summary>
/// Constructs a <see cref="ChatSetupInfo"/> from optional <paramref name="baseInfo"/>
/// </summary>
/// <param name="provider">The <see cref="ChatProvider"/> that this <see cref="ChatSetupInfo"/> is for</param>
/// <param name="baseInfo">Optional past data</param>
/// <param name="numFields">The number of fields in this chat provider</param>
protected ChatSetupInfo(ChatSetupInfo baseInfo, int numFields)
protected internal ChatSetupInfo(ChatProvider provider, ChatSetupInfo baseInfo, int numFields)
{
numFields += BaseIndex;
InitializeFields = baseInfo == null || baseInfo.DataFields.Count != numFields;
@@ -62,23 +63,31 @@ namespace TGServiceInterface
}
else
DataFields = baseInfo.DataFields;
Provider = provider;
Specialize(true); //to check we have a valid provider
}
/// <summary>
/// Recreates <see langword="this"/> as the correct child <see cref="ChatSetupInfo"/>
/// </summary>
/// <param name="checkOnly">If <see langword="true"/>, <see langword="null"/> is returned provided <see cref="Provider"/> is a valid <see cref="ChatProvider"/></param>
/// <returns>A new <see cref="ChatSetupInfo"/> based on the <see cref="Provider"/> type</returns>
ChatSetupInfo Specialize()
ChatSetupInfo Specialize(bool checkOnly)
{
switch (Provider)
{
case ChatProvider.IRC:
return new IRCSetupInfo(this);
if (!checkOnly)
return new IRCSetupInfo(this);
break;
case ChatProvider.Discord:
return new DiscordSetupInfo(this);
if (!checkOnly)
return new DiscordSetupInfo(this);
break;
default:
throw new Exception("Invalid provider!");
}
return null;
}
/// <summary>
@@ -88,7 +97,7 @@ namespace TGServiceInterface
/// <returns>The formatted <see cref="string"/></returns>
protected virtual string SanitizeChannelName(string channel)
{
return Specialize().SanitizeChannelName(channel);
return Specialize(false).SanitizeChannelName(channel);
}
/// <summary>
@@ -115,6 +124,7 @@ namespace TGServiceInterface
public ChatSetupInfo(IList<string> DeserializedData)
{
DataFields = DeserializedData;
Specialize(false); //ensure provider type is valid
}
/// <summary>
/// The list of admin entries
@@ -211,25 +221,24 @@ namespace TGServiceInterface
const int AuthTargetIndex = 3;
const int AuthMessageIndex = 4;
const int AuthLevelIndex = 5;
const int FieldsLen = 6;
const int FieldsLen = 6;
/// <summary>
/// Construct IRC setup info from optional generic info. Defaults to TGS3 on rizons IRC server
/// </summary>
/// <param name="baseInfo">Optional generic info</param>
public IRCSetupInfo(ChatSetupInfo baseInfo = null) : base(baseInfo, FieldsLen)
public IRCSetupInfo(ChatSetupInfo baseInfo = null) : base(ChatProvider.IRC, baseInfo, FieldsLen)
{
Provider = ChatProvider.IRC;
if (InitializeFields)
{
Nickname = "TGS3";
URL = "irc.rizon.net";
Port = 6667;
AuthTarget = "";
AuthMessage = "";
AdminsAreSpecial = true;
AuthLevel = IRCMode.Op;
}
if (!InitializeFields)
return;
Nickname = "TGS3";
URL = "irc.rizon.net";
Port = 6667;
AuthTarget = "";
AuthMessage = "";
AdminsAreSpecial = true;
AuthLevel = IRCMode.Op;
}
/// <inheritdoc />
@@ -297,16 +306,16 @@ namespace TGServiceInterface
public sealed class DiscordSetupInfo : ChatSetupInfo
{
const int BotTokenIndex = 0;
const int FieldsLen = 1;
const int FieldsLen = 1;
/// <summary>
/// Construct Discord setup info from optional generic info. Default is not a valid discord bot tokent
/// </summary>
/// <param name="baseInfo">Optional generic info</param>
public DiscordSetupInfo(ChatSetupInfo baseInfo = null) : base(baseInfo, FieldsLen)
public DiscordSetupInfo(ChatSetupInfo baseInfo = null) : base(ChatProvider.Discord, baseInfo, FieldsLen)
{
Provider = ChatProvider.Discord;
if (InitializeFields)
BotToken = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; //needless to say, this is fake
if (!InitializeFields)
return;
BotToken = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; //needless to say, this is fake
}
/// <inheritdoc />
protected override string SanitizeChannelName(string working)
+53
View File
@@ -0,0 +1,53 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace TGServiceInterface.Tests
{
/// <summary>
/// Tests for <see cref="Helpers"/>
/// </summary>
[TestClass]
public class TestHelpers
{
/// <summary>
/// Sample cleartext
/// </summary>
const string PlainText = "According to all known laws of aviation, there is no way a bee should be able to fly. Its wings are too small to get its fat little body off the ground. The bee, of course, flies anyway because bees don't care what humans think is impossible.";
/// <summary>
/// Run assertions for a successful call to <see cref="Helpers.EncryptData(string, out string)"/>
/// </summary>
/// <param name="entropy">The out string for the entropy parameter of <see cref="Helpers.EncryptData(string, out string)"/></param>
/// <returns>The result of <see cref="Helpers.EncryptData(string, out string)"/> with <see cref="PlainText"/> as a parameter</returns>
string AssertEncryptData(out string entropy)
{
var result = Helpers.EncryptData(PlainText, out entropy);
Assert.AreNotEqual(PlainText, entropy);
Assert.AreNotEqual(PlainText, result);
Assert.AreNotEqual(result, entropy);
Assert.IsFalse(String.IsNullOrWhiteSpace(result));
Assert.IsFalse(String.IsNullOrWhiteSpace(entropy));
return result;
}
/// <summary>
/// Tests that <see cref="Helpers.EncryptData(string, out string)"/> can execute successfully
/// </summary>
[TestMethod]
public void TestEncryptDataWorks()
{
AssertEncryptData(out string entropy);
}
/// <summary>
/// Tests that <see cref="Helpers.DecryptData(string, string)"/> can execute successfully
/// </summary>
[TestMethod]
public void TestDecryptDataWorks()
{
var result = AssertEncryptData(out string entropy);
var decrypted = Helpers.DecryptData(result, entropy);
Assert.AreEqual(decrypted, PlainText);
}
}
}
+80
View File
@@ -0,0 +1,80 @@
using System;
using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace TGServiceInterface.Tests
{
/// <summary>
/// Tests for <see cref="Interface"/>
/// </summary>
[TestClass]
public class TestInterface
{
/// <summary>
/// Test that <see cref="Interface.SetBadCertificateHandler(Func{string, bool})"/> can execute successfully
/// </summary>
[TestMethod]
public void TestSetBadCertificateHandler()
{
Func<string, bool> func = (message) =>
{
Assert.IsFalse(String.IsNullOrWhiteSpace(message));
return true;
};
Interface.SetBadCertificateHandler(func);
}
/// <summary>
/// Test that <see cref="Interface.SetBadCertificateHandler(Func{string, bool})"/> properly sets <see cref="ServicePointManager.ServerCertificateValidationCallback"/>
/// </summary>
[TestMethod]
public void TestBadCertificateHandler()
{
var ran = false;
Interface.SetBadCertificateHandler(_ =>
{
ran = true;
return true;
});
ServicePointManager.ServerCertificateValidationCallback(this, new System.Security.Cryptography.X509Certificates.X509Certificate(), new System.Security.Cryptography.X509Certificates.X509Chain(), System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors);
Assert.IsTrue(ran);
}
/// <summary>
/// Creates a remote configured <see cref="Interface"/> pointing at an invalid address
/// </summary>
/// <returns>The created <see cref="Interface"/></returns>
Interface CreateFakeRemoteInterface()
{
return new Interface("some.fake.url.420", 34752, "user", "password");
}
/// <summary>
/// Test that <see cref="Interface.Interface"/> can execute successfully and creates a local connection
/// </summary>
[TestMethod]
public void TestLocalInstantiation()
{
Assert.IsFalse(new Interface().IsRemoteConnection);
}
/// <summary>
/// Test that <see cref="Interface(string, ushort, string, string)"/> can execute successfully
/// </summary>
[TestMethod]
public void TestRemoteInstatiation()
{
Assert.IsTrue(CreateFakeRemoteInterface().IsRemoteConnection);
}
[TestMethod]
public void TestCopyRemoteInterface()
{
var first = CreateFakeRemoteInterface();
var second = new Interface(first);
Assert.AreEqual(first.HTTPSURL, second.HTTPSURL);
Assert.AreEqual(first.HTTPSPort, second.HTTPSPort);
Assert.IsTrue(second.IsRemoteConnection);
}
}
}
+10
View File
@@ -0,0 +1,10 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("TGStation Server Test Suite")]
[assembly: AssemblyDescription("Unit tests for the TGStation Server suite")]
[assembly: ComVisible(false)]
[assembly: Guid("fb693ffb-17e3-4e84-8cbf-6ffa9c8fd971")]
+27
View File
@@ -0,0 +1,27 @@
namespace TGServerService.Tests
{
/// <summary>
/// For accessing service control methods of <see cref="Service"/>
/// </summary>
class ServiceAccessor : Service
{
/// <summary>
/// Fake a <see cref="Service"/> start up
/// </summary>
/// <param name="args">Fake commandline parameters passed to <see cref="OnStart"/></param>
public void FakeStart(string[] args)
{
OnStart(args);
}
/// <summary>
/// Fake a <see cref="Service"/> shutdown
/// </summary>
public void FakeStop()
{
OnStop();
}
}
}
@@ -0,0 +1,62 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using TGServiceTests;
namespace TGServerService.Tests
{
/// <summary>
/// Tests for <see cref="InstanceConfig"/>
/// </summary>
[TestClass]
public class TestInstanceConfig : TempDirectoryRequiredTest
{
/// <summary>
/// The path to the <see cref="InstanceConfig"/> JSON at <see cref="TempPath"/>
/// </summary>
string InstanceJSONPath { get { return Path.Combine(TempPath, InstanceConfig.JSONFilename); } }
/// <summary>
/// Creates a default <see cref="InstanceConfig"/> at <see cref="TempPath"/>
/// </summary>
/// <returns></returns>
InstanceConfig CreateTempConfig()
{
return new InstanceConfig(TempPath);
}
/// <summary>
/// Test that <see cref="InstanceConfig(string)"/> can execute successfully and doesn't automatically save
/// </summary>
[TestMethod]
public void TestCreate()
{
var IC = CreateTempConfig();
Assert.IsFalse(File.Exists(InstanceJSONPath));
}
/// <summary>
/// Test that <see cref="InstanceConfig.Save"/> works correctly
/// </summary>
[TestMethod]
public void TestSave()
{
var IC = CreateTempConfig();
IC.Save();
Assert.IsTrue(File.Exists(InstanceJSONPath));
}
/// <summary>
/// Test that <see cref="InstanceConfig.Load(string)"/> works correctly
/// </summary>
[TestMethod]
public void TestLoad()
{
var IC = CreateTempConfig();
var name = "asdf";
IC.Name = name;
IC.Save();
var IC2 = InstanceConfig.Load(TempPath);
Assert.AreEqual(name, IC2.Name);
}
}
}
@@ -0,0 +1,21 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TGServiceTests;
namespace TGServerService.Tests
{
/// <summary>
/// Tests for <see cref="ServerInstance"/>
/// </summary>
[TestClass]
public class TestServerInstance : TempDirectoryRequiredTest
{
/// <summary>
/// Test a <see cref="ServerInstance"/> can be created and destroyed successfully with a basic <see cref="InstanceConfig"/>
/// </summary>
[TestMethod]
public void TestBasicInstantiation()
{
new ServerInstance(new InstanceConfig(TempPath), 1).Dispose();
}
}
}
+47
View File
@@ -0,0 +1,47 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TGServiceTests;
namespace TGServerService.Tests
{
/// <summary>
/// Tests for <see cref="Service"/>
/// </summary>
[TestClass]
public class TestService : TempDirectoryRequiredTest
{
/// <summary>
/// Test <see cref="Service.Service"/> can execute successfully
/// </summary>
[TestMethod]
public void TestInstantiation()
{
new Service().Dispose();
}
/// <summary>
/// Test <see cref="Service.OnStart(string[])"/> and <see cref="Service.OnStop"/> can execute successfully
/// </summary>
[TestMethod]
public void TestStartupAndShutdown()
{
using (var S = new ServiceAccessor())
{
S.FakeStart(new string[] { });
S.FakeStop();
}
}
/// <summary>
/// Test <see cref="Service.OnStart(string[])"/> and <see cref="Service.OnStop"/> can execute successfully with a commandline port override
/// </summary>
[TestMethod]
public void TestCommandLinePortSet()
{
using (var S = new ServiceAccessor())
{
S.FakeStart(new string[] { "-port", "36785" });
S.FakeStop();
}
}
}
}
+87
View File
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FB693FFB-17E3-4E84-8CBF-6FFA9C8FD971}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TGServiceTests</RootNamespace>
<AssemblyName>TGServiceTests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceProcess" />
</ItemGroup>
<ItemGroup>
<Compile Include="Interface\TestHelpers.cs" />
<Compile Include="Interface\TestInterface.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Service\ServiceAccessor.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Service\TestInstanceConfig.cs" />
<Compile Include="Service\TestServerInstance.cs" />
<Compile Include="Service\TestService.cs" />
<Compile Include="TempDirectoryRequiredTest.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\TGServerService\TGServerService.csproj">
<Project>{f32eda25-0855-411c-af5e-f0d042917e2d}</Project>
<Name>TGServerService</Name>
</ProjectReference>
<ProjectReference Include="..\TGServiceInterface\TGServiceInterface.csproj">
<Project>{ac4e7e8b-f83a-481c-a8b0-8fa4e8ae59ab}</Project>
<Name>TGServiceInterface</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<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\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" />
</Project>
@@ -0,0 +1,41 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
namespace TGServiceTests
{
/// <summary>
/// To be the parent of test classes that required a temporary directory
/// </summary>
public class TempDirectoryRequiredTest
{
/// <summary>
/// The path to the temporary directory
/// </summary>
protected string TempPath;
/// <summary>
/// Construct a <see cref="TempDirectoryRequiredTest"/>
/// </summary>
internal TempDirectoryRequiredTest() { }
/// <summary>
/// Setup <see cref="TempPath"/>
/// </summary>
[TestInitialize]
public void Setup()
{
TempPath = Path.GetTempFileName();
File.Delete(TempPath);
Directory.CreateDirectory(TempPath);
}
/// <summary>
/// Cleanup <see cref="TempPath"/>
/// </summary>
[TestCleanup]
public void Cleanup()
{
Directory.Delete(TempPath, true);
}
}
}
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.1.18" targetFramework="net461" />
<package id="MSTest.TestFramework" version="1.1.18" targetFramework="net461" />
</packages>
+7 -1
View File
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.16
VisualStudioVersion = 15.0.27004.2006
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TGServerService", "TGServerService\TGServerService.csproj", "{F32EDA25-0855-411C-AF5E-F0D042917E2D}"
EndProject
@@ -88,6 +88,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{287B
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TGDreamDaemonBridge", "TGDreamDaemonBridge\TGDreamDaemonBridge.csproj", "{9A01EF03-8EAE-45CB-8B87-4A17BD904557}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TGServiceTests", "TGServiceTests\TGServiceTests.csproj", "{FB693FFB-17E3-4E84-8CBF-6FFA9C8FD971}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -120,6 +122,10 @@ Global
{9A01EF03-8EAE-45CB-8B87-4A17BD904557}.Debug|Any CPU.Build.0 = Debug|x86
{9A01EF03-8EAE-45CB-8B87-4A17BD904557}.Release|Any CPU.ActiveCfg = Release|x86
{9A01EF03-8EAE-45CB-8B87-4A17BD904557}.Release|Any CPU.Build.0 = Release|x86
{FB693FFB-17E3-4E84-8CBF-6FFA9C8FD971}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB693FFB-17E3-4E84-8CBF-6FFA9C8FD971}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB693FFB-17E3-4E84-8CBF-6FFA9C8FD971}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB693FFB-17E3-4E84-8CBF-6FFA9C8FD971}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+52 -52
View File
@@ -1,52 +1,52 @@
pull_requests:
do_not_increment_build_number: true
environment:
repo_token:
secure: lJNGAXwiB5HlWdthz3K4PetqpTG5IEAyRgKaiKxFMQ8HW8CcOjRtB97B05op7BsK
skip_branch_with_pr: true
image: Visual Studio 2017
configuration: Release
shallow_clone: true
artifacts:
- path: TGS3-Server-v*.exe
name: TGS3Server
- path: MD5-SHA1-Server-v*.txt
name: MD5SHA1Server
- path: TGS3-Client-v*.zip
name: TGS3Client
- path: MD5-SHA1-Client-v*.txt
name: MD5SHA1Client
cache:
- packages -> **\packages.config
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
install:
- choco install fciv doxygen.portable graphviz.portable
before_build:
- nuget restore TGStationServer3.sln
build:
project: TGStationServer3.sln
parallel: true
verbosity: minimal
publish_nuget: true
after_build:
- ps: .\Tools\TGS3Build.ps1
- ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE -match "\[TGSDeploy\]"){$env:TGSDeploy = "Do it."}
- ps: $env:TGSVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$env:APPVEYOR_BUILD_FOLDER/TGServerService/bin/Release/TGServerService.exe").FileVersion
deploy:
- provider: GitHub
release: "tgstation-server-v$(TGSVersion)"
description: 'The /tg/station server suite'
auth_token:
secure: lJNGAXwiB5HlWdthz3K4PetqpTG5IEAyRgKaiKxFMQ8HW8CcOjRtB97B05op7BsK
artifact: TGS3Server,MD5SHA1Server,TGS3Client,MD5SHA1Client
draft: false
on:
TGSDeploy: "Do it."
- provider: NuGet
api_key:
secure: bedsYuLMqGREzkVkJqRx+BTMgOvDO76tgaNc8sW5E3Ao6iw8oGHdJ/BZov8y0iKa
skip_symbols: true
artifact: /.*\.nupkg/
on:
TGSDeploy: "Do it."
pull_requests:
do_not_increment_build_number: true
environment:
repo_token:
secure: lJNGAXwiB5HlWdthz3K4PetqpTG5IEAyRgKaiKxFMQ8HW8CcOjRtB97B05op7BsK
skip_branch_with_pr: true
image: Visual Studio 2017
configuration: Release
shallow_clone: true
artifacts:
- path: TGS3-Server-v*.exe
name: TGS3Server
- path: MD5-SHA1-Server-v*.txt
name: MD5SHA1Server
- path: TGS3-Client-v*.zip
name: TGS3Client
- path: MD5-SHA1-Client-v*.txt
name: MD5SHA1Client
cache:
- packages -> **\packages.config
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
install:
- choco install fciv doxygen.portable graphviz.portable
before_build:
- nuget restore TGStationServer3.sln
build:
project: TGStationServer3.sln
parallel: true
verbosity: minimal
publish_nuget: true
after_build:
- ps: .\Tools\TGS3Build.ps1
- ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE -match "\[TGSDeploy\]"){$env:TGSDeploy = "Do it."}
- ps: $env:TGSVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$env:APPVEYOR_BUILD_FOLDER/TGServerService/bin/Release/TGServerService.exe").FileVersion
deploy:
- provider: GitHub
release: "tgstation-server-v$(TGSVersion)"
description: 'The /tg/station server suite'
auth_token:
secure: lJNGAXwiB5HlWdthz3K4PetqpTG5IEAyRgKaiKxFMQ8HW8CcOjRtB97B05op7BsK
artifact: TGS3Server,MD5SHA1Server,TGS3Client,MD5SHA1Client
draft: false
on:
TGSDeploy: "Do it."
- provider: NuGet
api_key:
secure: bedsYuLMqGREzkVkJqRx+BTMgOvDO76tgaNc8sW5E3Ao6iw8oGHdJ/BZov8y0iKa
skip_symbols: true
artifact: /.*\.nupkg/
on:
TGSDeploy: "Do it."