Skip to content

Commit

Permalink
Merge pull request #2180 from ericoporto/add-autocomplete-tests-and-b…
Browse files Browse the repository at this point in the history
…ackport-editor-tests

Add autocomplete tests and backport editor tests
  • Loading branch information
ivan-mogilko authored Oct 16, 2023
2 parents 55c81e9 + 46e5913 commit 93c3f7f
Show file tree
Hide file tree
Showing 11 changed files with 1,320 additions and 4 deletions.
21 changes: 20 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ build_editor_task:
AGS_SDL_LIB: C:\Lib\SDL2\lib\x86
nuget_packages_cache:
folder: Solutions\packages
fingerprint_script: type Editor\AGS.Editor\packages.config
fingerprint_script:
- type Editor\AGS.Editor\packages.config
- type Editor\AGS.Editor.Tests\packages.config
populate_script: nuget restore Solutions\AGS.Editor.Full.sln
build_debug_script: >
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 &&
Expand All @@ -302,6 +304,12 @@ build_editor_task:
cmd /v:on /c "set "LIB=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Lib\um\x86;!LIB!" &&
set "PATH=C:\Program Files (x86)\Windows Kits\8.1\bin\x86;!PATH!" &&
msbuild AGS.Editor.Full.sln /p:PlatformToolset=v140 /p:Configuration=Debug /p:Platform="Mixed Platforms" /maxcpucount /nologo"
test_debug_script: |
curl -fLOJ https://github.com/nunit/nunit-transforms/raw/master/nunit3-junit/nunit3-junit.xslt
pushd Solutions\packages\NUnit.ConsoleRunner.3.*
set RUNNER="%CD%\tools\nunit3-console.exe"
popd
cmd /v:on /c "!RUNNER! Editor\AGS.Editor.Tests\bin\Debug\AGS.Editor.Tests.dll --result=TestResult-junit.xml;transform=nunit3-junit.xslt"
build_release_script: >
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 &&
set "UseEnv=true" &&
Expand All @@ -310,6 +318,17 @@ build_editor_task:
cmd /v:on /c "set "LIB=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Lib\um\x86;!LIB!" &&
set "PATH=C:\Program Files (x86)\Windows Kits\8.1\bin\x86;!PATH!" &&
msbuild AGS.Editor.Full.sln /p:PlatformToolset=v140 /p:Configuration=Release /p:Platform="Mixed Platforms" /maxcpucount /nologo"
test_release_script: |
curl -fLOJ https://github.com/nunit/nunit-transforms/raw/master/nunit3-junit/nunit3-junit.xslt
pushd Solutions\packages\NUnit.ConsoleRunner.3.*
set RUNNER="%CD%\tools\nunit3-console.exe"
popd
cmd /v:on /c "!RUNNER! Editor\AGS.Editor.Tests\bin\Release\AGS.Editor.Tests.dll --result=TestResult-junit.xml;transform=nunit3-junit.xslt"
always:
test_result_artifacts:
path: TestResult-junit.xml
type: text/xml
format: junit
ags_editor_pdb_artifacts:
path: Solutions/.build/*/*.pdb
ags_native_pdb_artifacts:
Expand Down
2 changes: 1 addition & 1 deletion Editor/AGS.CScript.Compiler/Preprocessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void DefineMacro(string name, string value)
public string Preprocess(string script, string scriptName)
{
StringBuilder output = new StringBuilder(script.Length);
output.AppendLine(Constants.NEW_SCRIPT_MARKER + scriptName + "\"");
output.AppendLine(Constants.NEW_SCRIPT_MARKER + scriptName.Replace(@"\", @"\\") + "\"");
StringReader reader = new StringReader(script);
string thisLine;
_scriptName = scriptName;
Expand Down
109 changes: 109 additions & 0 deletions Editor/AGS.Editor.Tests/AGS.Editor.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\Solutions\packages\Microsoft.NET.Test.Sdk.16.4.0\build\net40\Microsoft.NET.Test.Sdk.props" Condition="Exists('..\..\Solutions\packages\Microsoft.NET.Test.Sdk.16.4.0\build\net40\Microsoft.NET.Test.Sdk.props')" />
<Import Project="..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\build\netstandard1.0\Microsoft.CodeCoverage.props" Condition="Exists('..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\build\netstandard1.0\Microsoft.CodeCoverage.props')" />
<Import Project="..\..\Solutions\packages\NUnit3TestAdapter.3.16.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\Solutions\packages\NUnit3TestAdapter.3.16.1\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\..\Solutions\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\..\Solutions\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6D85D3E7-5D23-405F-BEF4-6F09A93ABCCC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AGS</RootNamespace>
<AssemblyName>AGS.Editor.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6</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>
<PlatformTarget>x86</PlatformTarget>
</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>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\..\Solutions\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.CodeCoverage.Shim, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\lib\net45\Microsoft.VisualStudio.CodeCoverage.Shim.dll</HintPath>
</Reference>
<Reference Include="NSubstitute, Version=4.2.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\..\Solutions\packages\NSubstitute.4.2.0\lib\net46\NSubstitute.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\Solutions\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\Solutions\packages\System.Threading.Tasks.Extensions.4.3.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Editor\AutoComplete\AutoCompleteTests.cs" />
<Compile Include="Editor\Panes\FreePanControlTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ScriptCompiler\PreprocessorTests.cs" />
<Compile Include="Types\SpriteTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AGS.CScript.Compiler\AGS.CScript.Compiler.csproj">
<Project>{4771753a-641d-49b1-8096-0b431eac413e}</Project>
<Name>AGS.CScript.Compiler</Name>
</ProjectReference>
<ProjectReference Include="..\AGS.Editor\AGSEditor.csproj">
<Project>{6c0d2bf2-2f34-42ff-8356-79254ccf3131}</Project>
<Name>AGSEditor</Name>
</ProjectReference>
<ProjectReference Include="..\AGS.Types\AGS.Types.csproj">
<Project>{3ebbedab-214c-4201-bb5a-5152d56908dd}</Project>
<Name>AGS.Types</Name>
</ProjectReference>
</ItemGroup>
<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('..\..\Solutions\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Solutions\packages\NUnit.3.12.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\..\Solutions\packages\NUnit3TestAdapter.3.16.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Solutions\packages\NUnit3TestAdapter.3.16.1\build\net35\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\build\netstandard1.0\Microsoft.CodeCoverage.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\build\netstandard1.0\Microsoft.CodeCoverage.props'))" />
<Error Condition="!Exists('..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\build\netstandard1.0\Microsoft.CodeCoverage.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\build\netstandard1.0\Microsoft.CodeCoverage.targets'))" />
<Error Condition="!Exists('..\..\Solutions\packages\Microsoft.NET.Test.Sdk.16.4.0\build\net40\Microsoft.NET.Test.Sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Solutions\packages\Microsoft.NET.Test.Sdk.16.4.0\build\net40\Microsoft.NET.Test.Sdk.props'))" />
<Error Condition="!Exists('..\..\Solutions\packages\Microsoft.NET.Test.Sdk.16.4.0\build\net40\Microsoft.NET.Test.Sdk.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Solutions\packages\Microsoft.NET.Test.Sdk.16.4.0\build\net40\Microsoft.NET.Test.Sdk.targets'))" />
</Target>
<Import Project="..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\build\netstandard1.0\Microsoft.CodeCoverage.targets" Condition="Exists('..\..\Solutions\packages\Microsoft.CodeCoverage.16.4.0\build\netstandard1.0\Microsoft.CodeCoverage.targets')" />
<Import Project="..\..\Solutions\packages\Microsoft.NET.Test.Sdk.16.4.0\build\net40\Microsoft.NET.Test.Sdk.targets" Condition="Exists('..\..\Solutions\packages\Microsoft.NET.Test.Sdk.16.4.0\build\net40\Microsoft.NET.Test.Sdk.targets')" />
</Project>
Loading

0 comments on commit 93c3f7f

Please sign in to comment.