Граф коммитов

17 Коммитов

Автор SHA1 Сообщение Дата
roxk 9632635431
Add helpers for implementing Out-Of-Proc COM Server with cppwinrt only (without WRL) (#440)
* Fix tests cmake not working with msvc + msbuild

* Initial impl of #439

* Make com server test a separate executable

* Fix not able to create non-projected implementation class

* Add tests

* Fix format

* Fix cannot set notifier directly

* Add test for defining module lock manually

* Rename default class factory

Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>

* Fix not using CppWinRTClassFactory elsewhere

* Clear tokens after revoking

* Make com_server_revoker non-copyable

* Do not record defaulted registration token

* Fix revoker not constructible

* Remove C++17 guard

* Handle server registration failure

Align behavior with WRL. Specifically, failing any server registration undo all registrations.

Fix revoke can throw, making dtor of com_server_revoker throw (which is bad)

* Remove C++/17 guard in tests

* De-templatize notifiable_module_lock

Make CustomModuleLockTest test user using another lock type

* Require user to define WINRT_CUSTOM_MODULE_LOCK

Detect and warn users to include notifiable_module_lock _before_ including winrt headers

* Fix format

* Update include/wil/cppwinrt_notifiable_module_lock.h

* Update include/wil/cppwinrt_register_com_server.h

* Add cppwinrt-com-server* tests to runtests.cmd

* Explain why push_back is safe

* Use wil::unique_com_class_object_cookie as revoker

* Ensure module lock's count is initialized

Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>

* Remove redundant try-catch

It was necessary, but now that we use wil's unique_com_class_cookie we
no longer need to catch, clean up and re-throw

* Try-catch CreateInstance

winrt::hresult doesn't seem to be recognized so it's handled separately

* Let wil handle winrt::hresult_error

* Add test for register_com_server failure

* Fix format

* Make notifiable_module_lock singleton #439

* Update activation after module starts waiting test

* Add notifiable_module_lock_base

---------

Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>
2024-03-28 10:53:35 -07:00
Duncan Horn b45b91eaf1
Consume Detours for function mocking (#421)
* Detours working for x64 in non-complex scenarios

* Refactor to get x86 working in a way that isn't terrible

* noexcept support

* Copying over some tests & adding a globally detoured type

* Malloc spy no longer necessary

* clang-format attempt 1

* clang-format round 2

* Fix some breaks

* Replace the mechanism testing for fail fast

* Another build failure

* Removing dead code

* Add new prerequisites to readme

* Some minor updates to the readme

* nits

* nits

* Fix swap & remove workaround

* Missed a comment

* format

* Make the destructor race test a little better and more deterministic

* Comments

* License & consume Catch2 from vcpkg

* Link error

* Bad copy paste

* Not going to support mocking member functions just yet

* spell check

* Feedback

* Add builtin-baseline for consistency

* Testing to see if this is the cause of crashes

* Testing this out

* Forgot to enable the test...

* Try using the version that waits for the thread to terminate

* Bump timeout to 20 seconds to see if that resolves failures

* Update comments & bump up wait to 30 sec
2024-01-04 20:55:07 -08:00
Alexander Sklar e2a0e70632
add for_each_window and for_each_thread_window helpers (#403)
* fix RegistryTests (warning as errors breaking on signed/unsigned comparison)

* add for_each_window and for_each_thread_window helpers

* .

* simplify wrappers, add child window, can work w/mutable lambdas

* format

* only expose throwing versions when  WIL_ENABLE_EXCEPTIONS is set

* 'format'

* .

* .

* unused result_t

* Update include/wil/windowing.h

Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>

* Update include/wil/windowing.h

Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>

* pr fb

---------

Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>
2024-01-04 13:58:08 -08:00
Duncan Horn 0d4d4d80ca
Fix & Parallelize the CI pipelines (#415)
* Call the right script

* Testing to see if we can run tests in parallel

* Testing to see if this might help

* Is this the right format?

* Just testing...

* Okay, fine

* Disabling Clang ASan on x64 for now

* Here goes nothing

* How about this/

* Do arrays like this work?

* Is it because I was missing a colon?

* More colons?

* Okay, now?

* Try split again

* I can't spell
2023-12-20 18:23:26 -08:00
Duncan Horn 025ca122e8
Some updates (#387) 2023-11-07 09:20:06 -08:00
Duncan Horn e0dc2f0fe3
Re-duplicate tracelogging macros to make the MSVC preprocessor happy (#351)
* At least the tests are useful

* Re-duplicate macros to make the MSVC preprocessor happy and me sad
2023-08-15 12:05:26 -07:00
Duncan Horn 4c557d6563
Get asan working & disabling ubsan test for now after VS update (#334) 2023-06-15 20:27:12 -07:00
Alexander Sklar 1c6126b044
Add property, event, and INPC helpers (#317)
* Add property, event, and INPC helpers

* .

* .

* rename header/tests, format.

* add /manifest:embed

* pr feedback

* make includeable multiple time to light up

* cmake supports manifests, huh cool!

* wil roinitialize

* tests passing

* >

* xaml must be unloaded before com rundown

* we cannot run the notify property test in the same process as the malloc spies one because of an issue in COM

* pr feedback

* use is-a instead of has-a

* .

* .

* pr feedback

* pr feedback

* add macro alterntive for notifying properties, cleanup

* pr fb
2023-04-28 17:20:12 -07:00
Duncan Horn 533e329663
Fix natvis for wistd types (#315)
* Fix natvis for wistd types

* Link in the natvis by default

* Satisfy Visual Studio's expected syntax
2023-04-04 14:56:28 -07:00
David Machaj ff3520b8fc
Port fixes from private repo (#287)
Co-authored-by: Jon Wiswall <jonwis@microsoft.com>
Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>
2023-01-19 09:28:07 -08:00
Duncan Horn ab663cfd89
Add Tests with Address & UB Sanitizers Enabled (#285)
* Getting address sanitizer to work with MSVC and compile with Clang

* Some CMake fixups

* Get it working for Clang

* Enable UBSan

* Still need to debug

* Temporarily revert use of /Ob2 due to bug in Clang

* Update tests/sanitize-address/CMakeLists.txt

* Update scripts/azure-pipelines.yml
2023-01-18 18:29:04 -08:00
Jon Wiswall aee497ee2e
Add natvis file, include in nuget (#237)
* Add natvis file, include in nuget

* Include natvis in test build

* Include natvis in nupkg

* Add natvis for vcpkg
2022-04-29 16:01:51 -07:00
Duncan Horn 9a8b9715ec
Manually run cppwinrt (#203) 2021-08-17 15:22:35 -07:00
Duncan Horn d17cbd96ed
Sync with 2a999a999d8a942847fceb056b203dcf3918cbf2 (#162) 2020-11-20 10:34:33 -08:00
p-groarke 8cabf25897
cmake : Add install target to support consuming WIL through cmake. (#137)
* cmake : Use PROJECT_SOURCE_DIR to support FetchContent.

* cmake : Add install target.

* cmake : Add options to disable packaging and unit tests.

* cmake : Typos and cleanup.
2020-05-07 13:36:12 -07:00
Duncan Horn 212ecbf230
Add Windows 7 tests and update ifdefs/etc. to match (#120) 2020-03-24 13:37:44 -07:00
Duncan Horn fbcd1d2abb
Add tests and other related things needed to get CI builds working (#11)
* Starting on CMake

* Start adding tests

* Yay, tests

* Stashing for now; need to full update the headers

* Update headers

* Last of the tests

* Noexcept tests!

* Build/conformance/etc/etc

* Add cppwinrt tests

* Exit code for scripts

* Will this compile now?

* Configurable CI build options

* oops

* Work around sadness

* minor update

* Hmm

* Just testing...

* Conditionally enable test

* Add nuspec

* hmm

* Add targets file

* Move back to license file to see what was wrong with it

* Take 2?

* Build nupkg with CMake since build servers have an old nuget version

* Update scripts for build machine purposes

* Case insensitive compare

* I've made this change so many times now...

* Revert str_raw_ptr change & add more in depth tests

* Don't build nuget by default

* Turns out reliance on path was a bad thing...

* Some cleanup
2019-04-30 10:26:35 -07:00