2019-08-13 15:23:28 +02:00
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
Fix unittesting our `.xaml` classes (#4105)
## Summary of the Pull Request
New year, new unittests.
This PR introduces a new project, `TestHostApp`. This project is largely taken from the TAEF samples, and allows us to easily construct a helper executable and `resources.pri` for running TerminalApp unittests.
## References
## PR Checklist
* [x] Closes #3986
* [x] I work here
* [x] is Tests
* [n/a] Requires documentation to be updated
* [x] **Waiting for an updated version of TAEF to be available**
## Detailed Description of the Pull Request / Additional comments
Unittesting for the TerminalApp project has been a horrifying process to try getting everything pieced together just right. Dependencies need to get added to manifests, binplaced correctly, and XAML resources need to get compiled together as well. In addition, using a MUX `Application` (as opposed to the Windows.UI.Xaml `Application`) has led to additional problems.
This was always a horrifying house of cards for us. Turns out, the reason this was so horrible is that the test infrastructure for doing what we're doing _literally didn't exist_ when I started doing all that work last year.
So, with help from the TAEF team, I was able to get rid of our entire house of cards, and use a much simpler project to build and run the tests.
Unfortunately, the latest TAEF release has a minor bug in it's build rules, and only publishes the x86 version of a dll we need from them. But, the rest of this PR works for x86, and I'll bump this when that updated version is available. We should be able to review this even in the state it's in.
## Validation Steps Performed
ran the tests yo
2020-01-10 19:55:31 +01:00
|
|
|
|
|
|
|
|
|
<!-- A note about this project: We're building the test code dll from this
|
|
|
|
|
project, but it _MUST_ be run in conjunction with the TestHostApp project.
|
|
|
|
|
TestHostApp actually will build a TestHost executable and packaging bits
|
|
|
|
|
that we can use to run our tests. We need TestHostApp so that our
|
|
|
|
|
dependencies, like MUX, can be aggregated correctly, and resources properly
|
|
|
|
|
combined into a resources.pri file.
|
|
|
|
|
|
|
|
|
|
TestHostApp will manually copy the output of this project into it's own
|
|
|
|
|
OutDir, so we can run the tests from there. -->
|
|
|
|
|
|
2019-11-05 23:29:11 +01:00
|
|
|
|
<PropertyGroup>
|
|
|
|
|
<ProjectGuid>{CA5CAD1A-b11c-4ddb-a4fe-c3afae9b5506}</ProjectGuid>
|
|
|
|
|
<Keyword>Win32Proj</Keyword>
|
|
|
|
|
<RootNamespace>TerminalAppLocalTests</RootNamespace>
|
|
|
|
|
<ProjectName>LocalTests_TerminalApp</ProjectName>
|
|
|
|
|
<TargetName>TerminalApp.LocalTests</TargetName>
|
|
|
|
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
2020-10-27 23:00:41 +01:00
|
|
|
|
<OpenConsoleCppWinRTProject>true</OpenConsoleCppWinRTProject>
|
2019-11-05 23:29:11 +01:00
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
2019-08-13 15:23:28 +02:00
|
|
|
|
<Import Project="$(SolutionDir)\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
Fix the TabTests! (#3833)
## Summary of the Pull Request
Fix the `TabTests`, and enable testing of types with XAML content. The `TabTests` were written many, many moons ago. they were intended to be our tests of XAML-like content within the Terminal app, so we could have unittests of Tabs, Panes, etc. Between their initial authoring and the day they were checked in, we had a bunch of build changes come in and break them irreperably.
We've gotten them fixed now with _one weird trick_ <sup>doctors hate me</sup>. As long as there isn't an `App.xbf` in the test's output directory, then the tests will deploy just fine.
We also needed a bit of magic, cribbed straight from TAEF, to enable running test code synchronously on the UI thread. Hence, `CppwinrtTailored.h`.
## References
## PR Checklist
* [x] Closes #2472
* [x] I work here
* [x] Tests added/passed - you better believe it
* [n/a] Requires documentation to be updated
## Validation Steps Performed
![image](https://user-images.githubusercontent.com/18356694/70185192-ef1d0b00-16ae-11ea-8799-b77061e3cdb0.png)
2019-12-06 21:45:08 +01:00
|
|
|
|
<Import Project="$(OpenConsoleDir)\src\cppwinrt.build.pre.props" />
|
2019-08-13 15:23:28 +02:00
|
|
|
|
|
2020-01-27 16:34:12 +01:00
|
|
|
|
<ItemDefinitionGroup>
|
|
|
|
|
<ClCompile>
|
|
|
|
|
<!-- For CLI11: It uses dynamic_cast to cast types around, which depends
|
|
|
|
|
on being compiled with RTTI (/GR). -->
|
|
|
|
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
|
|
|
|
</ClCompile>
|
|
|
|
|
</ItemDefinitionGroup>
|
|
|
|
|
|
2019-08-13 15:23:28 +02:00
|
|
|
|
<!-- ========================= Headers ======================== -->
|
|
|
|
|
<ItemGroup>
|
Fix the TabTests! (#3833)
## Summary of the Pull Request
Fix the `TabTests`, and enable testing of types with XAML content. The `TabTests` were written many, many moons ago. they were intended to be our tests of XAML-like content within the Terminal app, so we could have unittests of Tabs, Panes, etc. Between their initial authoring and the day they were checked in, we had a bunch of build changes come in and break them irreperably.
We've gotten them fixed now with _one weird trick_ <sup>doctors hate me</sup>. As long as there isn't an `App.xbf` in the test's output directory, then the tests will deploy just fine.
We also needed a bit of magic, cribbed straight from TAEF, to enable running test code synchronously on the UI thread. Hence, `CppwinrtTailored.h`.
## References
## PR Checklist
* [x] Closes #2472
* [x] I work here
* [x] Tests added/passed - you better believe it
* [n/a] Requires documentation to be updated
## Validation Steps Performed
![image](https://user-images.githubusercontent.com/18356694/70185192-ef1d0b00-16ae-11ea-8799-b77061e3cdb0.png)
2019-12-06 21:45:08 +01:00
|
|
|
|
<ClInclude Include="pch.h" />
|
|
|
|
|
<ClInclude Include="CppWinrtTailored.h" />
|
2019-08-13 15:23:28 +02:00
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<!-- ========================= Cpp Files ======================== -->
|
|
|
|
|
<ItemGroup>
|
2020-01-27 16:34:12 +01:00
|
|
|
|
<ClCompile Include="CommandlineTest.cpp" />
|
2019-08-13 15:23:28 +02:00
|
|
|
|
<ClCompile Include="SettingsTests.cpp" />
|
|
|
|
|
<ClCompile Include="TabTests.cpp" />
|
2020-11-06 02:37:45 +01:00
|
|
|
|
<ClCompile Include="FilteredCommandTests.cpp" />
|
Fix the TabTests! (#3833)
## Summary of the Pull Request
Fix the `TabTests`, and enable testing of types with XAML content. The `TabTests` were written many, many moons ago. they were intended to be our tests of XAML-like content within the Terminal app, so we could have unittests of Tabs, Panes, etc. Between their initial authoring and the day they were checked in, we had a bunch of build changes come in and break them irreperably.
We've gotten them fixed now with _one weird trick_ <sup>doctors hate me</sup>. As long as there isn't an `App.xbf` in the test's output directory, then the tests will deploy just fine.
We also needed a bit of magic, cribbed straight from TAEF, to enable running test code synchronously on the UI thread. Hence, `CppwinrtTailored.h`.
## References
## PR Checklist
* [x] Closes #2472
* [x] I work here
* [x] Tests added/passed - you better believe it
* [n/a] Requires documentation to be updated
## Validation Steps Performed
![image](https://user-images.githubusercontent.com/18356694/70185192-ef1d0b00-16ae-11ea-8799-b77061e3cdb0.png)
2019-12-06 21:45:08 +01:00
|
|
|
|
<ClCompile Include="pch.cpp">
|
2019-08-13 15:23:28 +02:00
|
|
|
|
<PrecompiledHeader>Create</PrecompiledHeader>
|
|
|
|
|
</ClCompile>
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<!-- ========================= Project References ======================== -->
|
|
|
|
|
<ItemGroup>
|
2020-08-21 00:44:37 +02:00
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalApp\TerminalAppLib.vcxproj" />
|
2019-08-13 15:23:28 +02:00
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)\src\types\lib\types.vcxproj" />
|
|
|
|
|
|
|
|
|
|
<!-- If you don't reference these projects here, the
|
|
|
|
|
_ConsoleGenerateAdditionalWinmdManifests step won't gather the winmd's -->
|
2020-12-11 22:34:57 +01:00
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj" />
|
2021-03-17 21:47:24 +01:00
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\dll\TerminalControl.vcxproj" />
|
2019-08-13 15:23:28 +02:00
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
2020-10-06 18:56:59 +02:00
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalApp\dll\TerminalApp.vcxproj" />
|
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsModel\dll\Microsoft.Terminal.Settings.Model.vcxproj" />
|
2019-08-13 15:23:28 +02:00
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<!-- ========================= Globals ======================== -->
|
|
|
|
|
|
|
|
|
|
<!-- ====================== Compiler & Linker Flags ===================== -->
|
|
|
|
|
<ItemDefinitionGroup>
|
|
|
|
|
<ClCompile>
|
2020-08-21 00:44:37 +02:00
|
|
|
|
<AdditionalIncludeDirectories>..;$(OpenConsoleDir)\dep;$(OpenConsoleDir)\dep\jsoncpp\json;$(OpenConsoleDir)src\inc;$(OpenConsoleDir)src\inc\test;$(WinRT_IncludePath)\..\cppwinrt\winrt;"$(OpenConsoleDir)\src\cascadia\TerminalApp\Generated Files";%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
Fix the TabTests! (#3833)
## Summary of the Pull Request
Fix the `TabTests`, and enable testing of types with XAML content. The `TabTests` were written many, many moons ago. they were intended to be our tests of XAML-like content within the Terminal app, so we could have unittests of Tabs, Panes, etc. Between their initial authoring and the day they were checked in, we had a bunch of build changes come in and break them irreperably.
We've gotten them fixed now with _one weird trick_ <sup>doctors hate me</sup>. As long as there isn't an `App.xbf` in the test's output directory, then the tests will deploy just fine.
We also needed a bit of magic, cribbed straight from TAEF, to enable running test code synchronously on the UI thread. Hence, `CppwinrtTailored.h`.
## References
## PR Checklist
* [x] Closes #2472
* [x] I work here
* [x] Tests added/passed - you better believe it
* [n/a] Requires documentation to be updated
## Validation Steps Performed
![image](https://user-images.githubusercontent.com/18356694/70185192-ef1d0b00-16ae-11ea-8799-b77061e3cdb0.png)
2019-12-06 21:45:08 +01:00
|
|
|
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
2019-08-13 15:23:28 +02:00
|
|
|
|
|
|
|
|
|
<!-- Manually disable unreachable code warning, because jconcpp has a ton of that. -->
|
|
|
|
|
<DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
|
|
|
|
</ClCompile>
|
|
|
|
|
<Link>
|
Fix the TabTests! (#3833)
## Summary of the Pull Request
Fix the `TabTests`, and enable testing of types with XAML content. The `TabTests` were written many, many moons ago. they were intended to be our tests of XAML-like content within the Terminal app, so we could have unittests of Tabs, Panes, etc. Between their initial authoring and the day they were checked in, we had a bunch of build changes come in and break them irreperably.
We've gotten them fixed now with _one weird trick_ <sup>doctors hate me</sup>. As long as there isn't an `App.xbf` in the test's output directory, then the tests will deploy just fine.
We also needed a bit of magic, cribbed straight from TAEF, to enable running test code synchronously on the UI thread. Hence, `CppwinrtTailored.h`.
## References
## PR Checklist
* [x] Closes #2472
* [x] I work here
* [x] Tests added/passed - you better believe it
* [n/a] Requires documentation to be updated
## Validation Steps Performed
![image](https://user-images.githubusercontent.com/18356694/70185192-ef1d0b00-16ae-11ea-8799-b77061e3cdb0.png)
2019-12-06 21:45:08 +01:00
|
|
|
|
<AdditionalDependencies>onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
2019-08-13 15:23:28 +02:00
|
|
|
|
</Link>
|
|
|
|
|
</ItemDefinitionGroup>
|
|
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
|
<GenerateManifest>true</GenerateManifest>
|
|
|
|
|
<EmbedManifest>true</EmbedManifest>
|
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
|
|
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
|
|
|
|
|
<Import Project="$(OpenConsoleDir)src\common.build.post.props" />
|
|
|
|
|
<Import Project="$(OpenConsoleDir)src\common.build.tests.props" />
|
|
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
|
<!-- From Microsoft.UI.Xaml.targets -->
|
|
|
|
|
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
|
|
|
|
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
2020-12-05 00:49:45 +01:00
|
|
|
|
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
2019-08-13 15:23:28 +02:00
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
|
|
<!-- We actually can just straight up reference MUX here, it's fine -->
|
2020-12-05 00:49:45 +01:00
|
|
|
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
2020-12-10 02:30:00 +01:00
|
|
|
|
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
2019-08-13 15:23:28 +02:00
|
|
|
|
|
|
|
|
|
</Project>
|