aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.MbaHost/EngineForTest.h
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2019-12-22 13:51:35 +1100
committerSean Hall <r.sean.hall@gmail.com>2019-12-22 13:34:07 +1000
commit4a176b759c47fa1970fcfd0d9e25c294bda82ef4 (patch)
tree961cc91c44569d72c12d9f2dc5b1c11a80bb94a9 /src/test/WixToolsetTest.MbaHost/EngineForTest.h
parent43fb611edc680a74d229e8f1eeacb30adad8e3c7 (diff)
downloadwix-4a176b759c47fa1970fcfd0d9e25c294bda82ef4.tar.gz
wix-4a176b759c47fa1970fcfd0d9e25c294bda82ef4.tar.bz2
wix-4a176b759c47fa1970fcfd0d9e25c294bda82ef4.zip
Update the MbaHost test project to use an external exe to load the BA, which allows loading a different .NET than the one running the tests. This also allows writing the tests in C# instead of C++/CLI.
Diffstat (limited to 'src/test/WixToolsetTest.MbaHost/EngineForTest.h')
-rw-r--r--src/test/WixToolsetTest.MbaHost/EngineForTest.h63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/test/WixToolsetTest.MbaHost/EngineForTest.h b/src/test/WixToolsetTest.MbaHost/EngineForTest.h
deleted file mode 100644
index 6058e67c..00000000
--- a/src/test/WixToolsetTest.MbaHost/EngineForTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
1#pragma once
2// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
3
4HRESULT WINAPI EngineForTestProc(
5 __in BOOTSTRAPPER_ENGINE_MESSAGE message,
6 __in const LPVOID pvArgs,
7 __inout LPVOID pvResults,
8 __in_opt LPVOID pvContext
9);
10
11typedef void(WINAPI *PFN_TEST_LOG_PROC)(
12 __in LPCWSTR sczMessage
13 );
14
15struct BOOTSTRAPPER_ENGINE_CONTEXT
16{
17 PFN_TEST_LOG_PROC pfnLog;
18};
19
20namespace WixToolsetTest
21{
22namespace MbaHost
23{
24namespace Native
25{
26 using namespace System;
27 using namespace System::Collections::Generic;
28 using namespace System::Runtime::InteropServices;
29
30 public ref class EngineForTest
31 {
32 private:
33 delegate void LogDelegate(LPCWSTR);
34 LogDelegate^ _logDelegate;
35 List<String^>^ _messages;
36
37 void Log(LPCWSTR sczMessage)
38 {
39 String^ message = gcnew String(sczMessage);
40 System::Diagnostics::Debug::WriteLine(message);
41 _messages->Add(message);
42 }
43 public:
44 EngineForTest()
45 {
46 _logDelegate = gcnew LogDelegate(this, &EngineForTest::Log);
47 _messages = gcnew List<String^>();
48 }
49
50 List<String^>^ GetLogMessages()
51 {
52 return _messages;
53 }
54
55 PFN_TEST_LOG_PROC GetTestLogProc()
56 {
57 IntPtr functionPointer = Marshal::GetFunctionPointerForDelegate(_logDelegate);
58 return static_cast<PFN_TEST_LOG_PROC>(functionPointer.ToPointer());
59 }
60 };
61}
62}
63} \ No newline at end of file