Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1245 update c sharp #1256

Merged
merged 2 commits into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions TypeCobol.LanguageServer.Test/LSRTestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class LSRTestHelper
/// -config contains the path to the config file necessary for TypeCobolLSR initialization
/// -init Give the initialize file path
/// {4} is filled with -td option if activateTdOption is true. This option will allow to avoid TypeCobolServer to do Node Refresh
/// {5} is filled with -sc if useSyntaxColoring is set to true.
/// {8} is filled with -sc if useSyntaxColoring is set to true.
/// </summary>
private static readonly string defaultTypeCobolLSArgs = "-r -lsr={0} -ro=\" -init={1} -config={2}\" -script={3} {4} {5} {6}";
private static readonly string defaultTypeCobolLSArgs = "-r -lsr={0} -ro=\"-lf={6} -l=3 -init={1} -config={2}\" -script={3} {4} {5} -lf={7} -l=3 {8}";
/// <summary>
/// LSR Test Timeout in milli secondes.
/// </summary>
Expand Down Expand Up @@ -71,11 +71,30 @@ public static void Test(string testFolderName, LsrTestingOptions lsrTestingOptio
//Write the config file content into generatedConfig.json file
File.WriteAllText(configGeneratedFileInfo.FullName, configFileContent);

//Pre-Create the Result directory.
var workingDir =
new DirectoryInfo(testWorkingDirectory);
workingDir.CreateSubdirectory(Path.Combine("input", "Results"));

//Specify log file for LSR
var logFile = Path.Combine(workingDir.FullName, "LSRLog.txt");

//Specify log file for TC LSP
var tcLogFile = Path.Combine(workingDir.FullName, "TCLSPLog.txt");

var scriptFileInfo = new FileInfo(scriptPath);
//Setup the arguments
//The path for LanguageServerRobot depends on the NuGetPackage. If the NuGet is not downloaded, it won't works
var arguments = string.Format(defaultTypeCobolLSArgs, @"TypeCobol.LanguageServerRobot.exe", initGeneratedFileInfo.FullName, configGeneratedFileInfo.FullName, scriptFileInfo.FullName, activateTdOption ? "-td" : "", useSyntaxColoring ? "-sc" : "", lsrTestingOption.ToLanguageServerOption());
var arguments = string.Format(defaultTypeCobolLSArgs,
@"TypeCobol.LanguageServerRobot.exe",
initGeneratedFileInfo.FullName,
configGeneratedFileInfo.FullName,
scriptFileInfo.FullName,
activateTdOption ? "-td" : "",
lsrTestingOption.ToLanguageServerOption(),
logFile,
tcLogFile,
useSyntaxColoring ? "-sc" : "");

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
Expand All @@ -87,7 +106,18 @@ public static void Test(string testFolderName, LsrTestingOptions lsrTestingOptio
process.Start();
process.WaitForExit(LSR_TEST_TIMEOUT);
if (!process.HasExited)
{
System.Console.WriteLine("!!!! TC-LSP PROCESS KILLED !!!");
process.Kill();
}
else
{
if (process.ExitCode != 0 && process.ExitCode != 1)
{
System.Console.WriteLine("!!!! TC-LSP PROCESS EXIT CODE" + process.ExitCode);
}
}

DirectoryInfo expectedOutputDir = new DirectoryInfo(testWorkingDirectory + Path.DirectorySeparatorChar + "output_expected");
DirectoryInfo resultOutputDir = new DirectoryInfo(testWorkingDirectory + Path.DirectorySeparatorChar + "input" + Path.DirectorySeparatorChar + "Results");
bool dirIdentical = UnitTestHelper.CompareDirectory(expectedOutputDir, resultOutputDir, "TypeCobol.LanguageServer.Test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,14 @@
<HintPath>..\packages\TypeCobol.LanguageServer.JsonRPC.1.0.1\lib\net45\TypeCobol.LanguageServer.JsonRPC.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="TypeCobol.LanguageServer.Protocol, Version=0.5.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TypeCobol.LanguageServer.Protocol.0.5.1\lib\net45\TypeCobol.LanguageServer.Protocol.dll</HintPath>
<Private>True</Private>
<Reference Include="TypeCobol.LanguageServer.Protocol, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TypeCobol.LanguageServer.Protocol.1.0.0\lib\net45\TypeCobol.LanguageServer.Protocol.dll</HintPath>
</Reference>
<Reference Include="TypeCobol.LanguageServer.Robot.Common, Version=0.5.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TypeCobol.LanguageServer.Robot.Common.0.5.1\lib\net45\TypeCobol.LanguageServer.Robot.Common.dll</HintPath>
<Private>True</Private>
<Reference Include="TypeCobol.LanguageServer.Robot.Common, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TypeCobol.LanguageServer.Robot.Common.1.1.0\lib\net45\TypeCobol.LanguageServer.Robot.Common.dll</HintPath>
</Reference>
<Reference Include="TypeCobol.LanguageServerRobot, Version=0.5.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TypeCobol.LanguageServerRobot.0.5.1\lib\net45\TypeCobol.LanguageServerRobot.exe</HintPath>
<Private>True</Private>
<Reference Include="TypeCobol.LanguageServerRobot, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TypeCobol.LanguageServerRobot.1.2.0\lib\net45\TypeCobol.LanguageServerRobot.exe</HintPath>
</Reference>
</ItemGroup>
<Choose>
Expand Down
6 changes: 3 additions & 3 deletions TypeCobol.LanguageServer.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net45" />
<package id="TypeCobol.LanguageServer.JsonRPC" version="1.0.1" targetFramework="net45" />
<package id="TypeCobol.LanguageServer.Protocol" version="0.5.1" targetFramework="net45" />
<package id="TypeCobol.LanguageServer.Robot.Common" version="0.5.1" targetFramework="net45" />
<package id="TypeCobol.LanguageServerRobot" version="0.5.1" targetFramework="net45" />
<package id="TypeCobol.LanguageServer.Protocol" version="1.0.0" targetFramework="net45" />
<package id="TypeCobol.LanguageServer.Robot.Common" version="1.1.0" targetFramework="net45" />
<package id="TypeCobol.LanguageServerRobot" version="1.2.0" targetFramework="net45" />
</packages>
6 changes: 6 additions & 0 deletions TypeCobol.Transform.Test/TypeCobol.Transform.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -34,6 +35,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'EI_Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -43,6 +45,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'EI_Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -51,6 +54,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'EI_Debug_Net40|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -60,6 +64,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'EI_Release_Net40|AnyCPU'">
<OutputPath>..\bin\EI_Release_Net40\</OutputPath>
Expand All @@ -69,6 +74,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
7 changes: 5 additions & 2 deletions TypeCobol.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2046
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TypeCobol", "TypeCobol\TypeCobol.csproj", "{7AC7A3E5-91F2-44BF-955D-86CC61375742}"
ProjectSection(ProjectDependencies) = postProject
Expand Down Expand Up @@ -212,4 +212,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5AB9FEEC-6A89-4E2F-B00C-C16E048038CF}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion TypeCobol/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</PropertyGroup>

<PropertyGroup>
<LangVersion>6</LangVersion>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
11 changes: 11 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: 1.0.{build}
image: Visual Studio 2017
configuration:
- Debug
- Release
Expand All @@ -9,6 +10,7 @@ configuration:
#AppVeyor only use this file if you use GitHub repo.
#If you use Git public repo, you must copy this lines to your build settings


# scripts to run before build
before_build:
- nuget restore #install missing nuget packages
Expand All @@ -20,6 +22,15 @@ build:
project: TypeCobol.sln
verbosity: minimal

# To uncomment to activate Remote Desktop, will be deleted on job completed
#before_test:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

#To uncomment to block the job on test failure, so the Remote Desktop remains after test
#To continue the job, you have to delete a .txt on the Remote Desktop session located on the desktop
#on_failure:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

artifacts:
- path: bin\EI_TypeCobol_Release
name: EI_TypeCobol_Release
Expand Down