2019-08-13 15:23:28 +02:00
|
|
|
/*++
|
|
|
|
Copyright (c) Microsoft Corporation
|
|
|
|
Licensed under the MIT license.
|
|
|
|
|
|
|
|
Module Name:
|
|
|
|
- precomp.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
- Contains external headers to include in the precompile phase of console build process.
|
|
|
|
- Avoid including internal project headers. Instead include them only in the classes that need them (helps with test project building).
|
|
|
|
|
|
|
|
Author(s):
|
|
|
|
- Carlos Zamora (cazamor) April 2019
|
|
|
|
--*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-08-28 03:09:22 +02:00
|
|
|
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
|
|
|
#define BLOCK_TIL
|
2019-08-13 15:23:28 +02:00
|
|
|
// This includes support libraries from the CRT, STL, WIL, and GSL
|
|
|
|
#include "LibraryIncludes.h"
|
|
|
|
// This is inexplicable, but for whatever reason, cppwinrt conflicts with the
|
|
|
|
// SDK definition of this function, so the only fix is to undef it.
|
|
|
|
// from WinBase.h
|
|
|
|
// Windows::UI::Xaml::Media::Animation::IStoryboard::GetCurrentTime
|
|
|
|
#ifdef GetCurrentTime
|
|
|
|
#undef GetCurrentTime
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
#include <wil/cppwinrt.h>
|
|
|
|
#include <unknwn.h>
|
|
|
|
#include <hstring.h>
|
|
|
|
|
2019-08-13 15:23:28 +02:00
|
|
|
#include <WexTestClass.h>
|
|
|
|
#include <json.h>
|
|
|
|
#include "consoletaeftemplates.hpp"
|
|
|
|
|
2020-05-04 22:57:12 +02:00
|
|
|
#include <winrt/Windows.ApplicationModel.Resources.Core.h>
|
|
|
|
#include "winrt/Windows.UI.Xaml.Markup.h"
|
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
|
|
|
#include <winrt/Windows.system.h>
|
2019-08-13 15:23:28 +02:00
|
|
|
#include <winrt/Windows.Foundation.h>
|
|
|
|
#include <winrt/Windows.Foundation.Collections.h>
|
|
|
|
#include <winrt/windows.ui.core.h>
|
|
|
|
#include <winrt/Windows.ui.input.h>
|
|
|
|
#include <winrt/Windows.UI.Xaml.Controls.h>
|
|
|
|
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
|
|
|
|
#include <winrt/Windows.ui.xaml.media.h>
|
|
|
|
#include <winrt/Windows.ui.xaml.input.h>
|
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
|
|
|
#include <winrt/Windows.UI.Xaml.Markup.h>
|
|
|
|
#include <winrt/Windows.UI.Xaml.Documents.h>
|
2019-08-13 15:23:28 +02:00
|
|
|
|
|
|
|
#include <windows.ui.xaml.media.dxinterop.h>
|
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
|
|
|
|
|
|
|
#include <winrt/windows.applicationmodel.core.h>
|
|
|
|
|
|
|
|
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
2020-10-06 18:56:59 +02:00
|
|
|
#include <winrt/Microsoft.Terminal.Settings.Model.h>
|
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
|
|
|
|
|
|
|
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
2020-01-27 16:34:12 +01:00
|
|
|
|
|
|
|
#include <regex>
|
|
|
|
#include <CLI11/CLI11.hpp>
|
2020-08-28 03:09:22 +02:00
|
|
|
|
|
|
|
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
|
|
|
#include "til.h"
|
|
|
|
|
|
|
|
// Common includes for most tests:
|
|
|
|
#include "../../inc/argb.h"
|
|
|
|
#include "../../inc/conattrs.hpp"
|
|
|
|
#include "../../types/inc/utils.hpp"
|
|
|
|
#include "../../inc/DefaultSettings.h"
|