Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
compiler: [MSVC, clang-cl]
arch: [x86, x64, arm64]
config: [Debug, Release]
test_exe: [test, test_cpp20, test_cpp20_no_sourcelocation, test_fast, test_slow, test_old, test_module_lock_custom, test_module_lock_none]
test_exe: [test, test_cpp20, test_cpp20_no_sourcelocation, test_fast, test_slow, test_old, test_module_lock_custom, test_module_lock_none, stress_test]
exclude:
- arch: arm64
config: Debug
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.nupkg
test*.xml
test*_results.txt
stress_test_results.txt
test_failures.txt
build
packages
Expand Down
1 change: 1 addition & 0 deletions build_test_all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platfor
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test_module_lock_none
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\test_module_lock_none
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\old_tests\test_old
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:test\stress_test

call run_tests.cmd %target_platform% %target_configuration%
19 changes: 19 additions & 0 deletions cppwinrt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
run_tests.cmd = run_tests.cmd
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress_test", "test\stress_test\stress_test.vcxproj", "{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}"
ProjectSection(ProjectDependencies) = postProject
{A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270}
{D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Expand Down Expand Up @@ -394,6 +400,18 @@ Global
{D4C8F881-84D5-4A7B-8BDE-AB4E34A05374}.Release|x64.Build.0 = Release|x64
{D4C8F881-84D5-4A7B-8BDE-AB4E34A05374}.Release|x86.ActiveCfg = Release|Win32
{D4C8F881-84D5-4A7B-8BDE-AB4E34A05374}.Release|x86.Build.0 = Release|Win32
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Debug|ARM64.Build.0 = Debug|ARM64
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Debug|x64.ActiveCfg = Debug|x64
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Debug|x64.Build.0 = Debug|x64
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Debug|x86.ActiveCfg = Debug|Win32
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Debug|x86.Build.0 = Debug|Win32
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Release|ARM64.ActiveCfg = Release|ARM64
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Release|ARM64.Build.0 = Release|ARM64
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Release|x64.ActiveCfg = Release|x64
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Release|x64.Build.0 = Release|x64
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Release|x86.ActiveCfg = Release|Win32
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -417,6 +435,7 @@ Global
{08C40663-B6A3-481E-8755-AE32BAD99501} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
{5FF6CD6C-515A-4D55-97B6-62AD9BCB77EA} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
{D4C8F881-84D5-4A7B-8BDE-AB4E34A05374} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C} = {3C7EA5F8-6E8C-4376-B499-2CAF596384B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2783B8FD-EA3B-4D6B-9F81-662D289E02AA}
Expand Down
1 change: 1 addition & 0 deletions run_tests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ call :run_test test_slow
call :run_test test_old
call :run_test test_module_lock_custom
call :run_test test_module_lock_none
call :run_test stress_test
goto :eof

:run_test
Expand Down
4 changes: 2 additions & 2 deletions strings/base_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

#ifdef _MSC_VER
// Note: this is a workaround for a false-positive warning produced by the Visual C++ 15.9 compiler.
#pragma warning(disable : 5046)
//#pragma warning(disable : 5046)

// Note: this is a workaround for a false-positive warning produced by the Visual C++ 16.3 compiler.
#pragma warning(disable : 4268)
//#pragma warning(disable : 4268)
#endif

#if defined(__cpp_lib_coroutine) || defined(__cpp_coroutines) || defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
Expand Down
26 changes: 26 additions & 0 deletions test/stress_test/GeneratePrecompiledHeader.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[string]$generatedFilesDir,

[Parameter(Mandatory=$true)]
[string]$cppwinrtHeaderFolder
)

if (!(Test-Path $generatedFilesDir))
{
mkdir $generatedFilesDir;
}

$generatedPchContent = "#pragma once`r`n`r`n";

$allHeaders = Get-ChildItem "$cppwinrtHeaderFolder\\Windows.*.h";
foreach ($header in $allHeaders)
{
$chunks = $header.FullName.Split("\\");
$header = $chunks[$chunks.Length - 1];
$generatedPchContent += "#include <winrt/$header>`r`n";
}

Set-Content -Path "$generatedFilesDir\\pch.h" -Value $generatedPchContent -Force -Encoding UTF8
13 changes: 13 additions & 0 deletions test/stress_test/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "pch.h"

using namespace winrt;

int main()
{
init_apartment();

winrt::Windows::Foundation::Uri uri{ L"https://www.microsoft.com" };
const auto asString = uri.ToString();

return 0;
}
1 change: 1 addition & 0 deletions test/stress_test/pch.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "pch.h"
108 changes: 108 additions & 0 deletions test/stress_test/stress_test.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</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">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
<MinimalCoreWin>true</MinimalCoreWin>
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{FF5FDA08-F84A-4AB1-9D8C-0EC78EA5A08C}</ProjectGuid>
<RootNamespace>stress_test</RootNamespace>
<ProjectName>stress_test</ProjectName>
<ConfigurationType>Application</ConfigurationType>
<!-- Not using the real nuget package so override-->
<CppWinRTPackageDir>..\_build\$(Platform)\$(Configuration)</CppWinRTPackageDir>
<CppWinRTPackage>false</CppWinRTPackage>
<!-- Null out CAExcludePath so that the include files are not automatically excluded from analysis. -->
<CAExcludePath>
</CAExcludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(OutputPath);Generated Files;..;..\..\cppwinrt</AdditionalIncludeDirectories>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningAsError>true</TreatWarningAsError>
<ExternalWarningLevel>Level4</ExternalWarningLevel>
<ExternalTemplatesDiagnostics>true</ExternalTemplatesDiagnostics>
<AnalyzeExternalRuleset>AllRules.ruleset</AnalyzeExternalRuleset>
<AdditionalOptions>%(AdditionalOptions) /Wv:19.40</AdditionalOptions>
<EnablePREfast>true</EnablePREfast>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
<PreBuildEvent>
<Command>powershell.exe -NoProfile -NonInteractive -File "$(ProjectDir)GeneratePrecompiledHeader.ps1" -generatedFilesDir "$(ProjectDir)Generated Files" -cppwinrtHeaderFolder "$(CppWinRTDir)\winrt"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NOMINMAX;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(ProjectDir)Generated Files\pch.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Loading