aboutsummaryrefslogtreecommitdiff
path: root/src/test/examples/TestEngine/ReloadEngine.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-04-23 12:26:07 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-04-23 12:43:38 +1000
commitab495395492055c8c016e54ab0b1f7af2e9f164c (patch)
treef7f86e82cb463303c5bf2e501065ea09a9b62af0 /src/test/examples/TestEngine/ReloadEngine.cpp
parentbd3ee565f342bc0bb015594f303d13b67285a958 (diff)
downloadwix-ab495395492055c8c016e54ab0b1f7af2e9f164c.tar.gz
wix-ab495395492055c8c016e54ab0b1f7af2e9f164c.tar.bz2
wix-ab495395492055c8c016e54ab0b1f7af2e9f164c.zip
Add reload engine and test.
Diffstat (limited to 'src/test/examples/TestEngine/ReloadEngine.cpp')
-rw-r--r--src/test/examples/TestEngine/ReloadEngine.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/test/examples/TestEngine/ReloadEngine.cpp b/src/test/examples/TestEngine/ReloadEngine.cpp
new file mode 100644
index 00000000..83541672
--- /dev/null
+++ b/src/test/examples/TestEngine/ReloadEngine.cpp
@@ -0,0 +1,43 @@
1// 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.
2
3#include "precomp.h"
4
5HRESULT RunReloadEngine(
6 __in LPCWSTR wzBundleFilePath,
7 __in LPCWSTR wzBAFilePath
8 )
9{
10 HRESULT hr = S_OK;
11 TestEngine* pTestEngine = NULL;
12
13 pTestEngine = new TestEngine();
14 ConsoleExitOnNull(pTestEngine, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "Failed to create new test engine.");
15
16 hr = pTestEngine->Initialize(wzBundleFilePath);
17 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to initialize engine.");
18
19 hr = pTestEngine->LoadBA(wzBAFilePath);
20 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA.");
21
22 hr = pTestEngine->SendStartupEvent();
23 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnStartup.");
24
25 hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER);
26 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown.");
27
28 pTestEngine->UnloadBA();
29
30 hr = pTestEngine->LoadBA(wzBAFilePath);
31 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA.");
32
33 hr = pTestEngine->SendStartupEvent();
34 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnStartup.");
35
36 hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RESTART);
37 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown.");
38
39 pTestEngine->UnloadBA();
40
41LExit:
42 return hr;
43}