Skip to content

Commit

Permalink
[ADDED] elc unit / functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arakov committed Mar 26, 2024
1 parent afd30e0 commit 0c6844d
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 9 deletions.
148 changes: 148 additions & 0 deletions elenasrc3/elena-tests/elena-tests.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{89a68a7e-1cb6-45cb-9b02-8183ff59284a}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\bin\</OutDir>
<IntDir>..\temp\elena-tests\</IntDir>
<TargetName>elena-tests</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\bin\</OutDir>
<TargetName>elena-tests64</TargetName>
<IntDir>..\temp\elena-tests64\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\bin\</OutDir>
<IntDir>..\temp\elena-tests\</IntDir>
<TargetName>elena-tests</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>elena-tests64</TargetName>
<OutDir>..\..\bin\</OutDir>
<IntDir>..\temp\elena-tests64\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>X64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="test.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\elc\vs\elc.vcxproj">
<Project>{85bbe576-02a3-414e-bf88-35280fafadad}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets" Condition="Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" />
</ImportGroup>
<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\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets'))" />
</Target>
</Project>
4 changes: 4 additions & 0 deletions elenasrc3/elena-tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" version="1.8.1.7" targetFramework="native" />
</packages>
5 changes: 5 additions & 0 deletions elenasrc3/elena-tests/pch.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// pch.cpp
//

#include "pch.h"
7 changes: 7 additions & 0 deletions elenasrc3/elena-tests/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// pch.h
//

#pragma once

#include "gtest/gtest.h"
6 changes: 6 additions & 0 deletions elenasrc3/elena-tests/test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "pch.h"

TEST(TestCaseName, TestName) {
EXPECT_EQ(1, 1);
EXPECT_TRUE(true);
}
18 changes: 9 additions & 9 deletions elenasrc3/elenasrc3.sln
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elt", "tools\elt\vs\elt.vcx
{E2686A7D-1888-4078-B5F3-63FD4F2682A4} = {E2686A7D-1888-4078-B5F3-63FD4F2682A4}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elena-testset", "elena-testset\vs\elena-testset.vcxproj", "{D2133413-B7C6-484A-AC50-44369C0BAE25}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elena-tests", "elena-tests\elena-tests.vcxproj", "{89A68A7E-1CB6-45CB-9B02-8183FF59284A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -130,14 +130,14 @@ Global
{BDA77ED4-5133-45DC-9E2A-EF1077600A27}.Release|x64.Build.0 = Release|x64
{BDA77ED4-5133-45DC-9E2A-EF1077600A27}.Release|x86.ActiveCfg = Release|Win32
{BDA77ED4-5133-45DC-9E2A-EF1077600A27}.Release|x86.Build.0 = Release|Win32
{D2133413-B7C6-484A-AC50-44369C0BAE25}.Debug|x64.ActiveCfg = Debug|x64
{D2133413-B7C6-484A-AC50-44369C0BAE25}.Debug|x64.Build.0 = Debug|x64
{D2133413-B7C6-484A-AC50-44369C0BAE25}.Debug|x86.ActiveCfg = Debug|Win32
{D2133413-B7C6-484A-AC50-44369C0BAE25}.Debug|x86.Build.0 = Debug|Win32
{D2133413-B7C6-484A-AC50-44369C0BAE25}.Release|x64.ActiveCfg = Release|x64
{D2133413-B7C6-484A-AC50-44369C0BAE25}.Release|x64.Build.0 = Release|x64
{D2133413-B7C6-484A-AC50-44369C0BAE25}.Release|x86.ActiveCfg = Release|Win32
{D2133413-B7C6-484A-AC50-44369C0BAE25}.Release|x86.Build.0 = Release|Win32
{89A68A7E-1CB6-45CB-9B02-8183FF59284A}.Debug|x64.ActiveCfg = Debug|x64
{89A68A7E-1CB6-45CB-9B02-8183FF59284A}.Debug|x64.Build.0 = Debug|x64
{89A68A7E-1CB6-45CB-9B02-8183FF59284A}.Debug|x86.ActiveCfg = Debug|Win32
{89A68A7E-1CB6-45CB-9B02-8183FF59284A}.Debug|x86.Build.0 = Debug|Win32
{89A68A7E-1CB6-45CB-9B02-8183FF59284A}.Release|x64.ActiveCfg = Release|x64
{89A68A7E-1CB6-45CB-9B02-8183FF59284A}.Release|x64.Build.0 = Release|x64
{89A68A7E-1CB6-45CB-9B02-8183FF59284A}.Release|x86.ActiveCfg = Release|Win32
{89A68A7E-1CB6-45CB-9B02-8183FF59284A}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 3 additions & 0 deletions recompile60.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ REM /m:2 is used to build using parallel compilation
"%InstallDir%\MSBuild\Current\Bin\MSBuild.exe" elenasrc3\elenasrc3.sln /p:configuration=release /p:Platform="x86" /m:2
IF NOT %ERRORLEVEL%==0 GOTO CompilerError

bin\elena-tests.exe
IF NOT %ERRORLEVEL%==0 GOTO CompilerError

REM /m:2 is used to build using parallel compilation
"%InstallDir%\MSBuild\Current\Bin\MSBuild.exe" elenasrc3\elenasrc3.sln /p:configuration=release /p:Platform="x64" /m:2
IF NOT %ERRORLEVEL%==0 GOTO CompilerError
Expand Down

0 comments on commit 0c6844d

Please sign in to comment.