|
6 | 6 | #include <Commands/InstallCommand.h> |
7 | 7 | #include <Commands/COMCommand.h> |
8 | 8 | #include <Workflows/DependenciesFlow.h> |
| 9 | +#include <Workflows/DownloadFlow.h> |
9 | 10 | #include <Workflows/InstallFlow.h> |
10 | 11 | #include <Workflows/ShellExecuteInstallerHandler.h> |
11 | 12 |
|
@@ -40,11 +41,12 @@ void OverrideForProcessMultiplePackages(TestContext& context) |
40 | 41 | } }); |
41 | 42 | } |
42 | 43 |
|
43 | | -void OverrideShellExecute(TestContext& context) |
| 44 | +void OverrideShellExecute(TestContext& context, std::vector<std::string>& installationOrder) |
44 | 45 | { |
45 | | - context.Override({ ShellExecuteInstallImpl, [](TestContext& c) |
| 46 | + context.Override({ ShellExecuteInstallImpl, [&installationOrder](TestContext& c) |
46 | 47 | { |
47 | | - c.Add< Execution::Data::OperationReturnCode>(0); |
| 48 | + installationOrder.push_back(c.Get<Execution::Data::Manifest>().Id); |
| 49 | + c.Add<Execution::Data::OperationReturnCode>(0); |
48 | 50 | } }); |
49 | 51 | } |
50 | 52 |
|
@@ -276,21 +278,34 @@ TEST_CASE("InstallFlow_Dependencies", "[InstallFlow][workflow][dependencies]") |
276 | 278 |
|
277 | 279 | TEST_CASE("InstallFlow_Dependencies_COM", "[InstallFlow][workflow][dependencies]") |
278 | 280 | { |
| 281 | + std::vector<std::string> installationOrder; |
| 282 | + |
279 | 283 | std::ostringstream installOutput; |
280 | 284 | TestContext context{ installOutput, std::cin }; |
281 | 285 | auto previousThreadGlobals = context.SetForCurrentThread(); |
282 | 286 | OverrideForShellExecute(context); |
283 | | - OverrideShellExecute(context); |
| 287 | + OverrideShellExecute(context, installationOrder); |
284 | 288 | OverrideOpenDependencySource(context); |
285 | 289 | OverrideEnableWindowsFeaturesDependencies(context); |
| 290 | + context.Override({ ReverifyInstallerHash, [](TestContext&) {} }); |
286 | 291 |
|
287 | 292 | context.Add<Execution::Data::Manifest>(YamlParser::CreateFromPath(TestDataFile("InstallFlowTest_MultipleDependencies.yaml"))); |
288 | 293 |
|
289 | 294 | COMDownloadCommand download({}); |
290 | 295 | download.Execute(context); |
291 | 296 |
|
| 297 | + REQUIRE(installationOrder.size() == 0); |
| 298 | + |
292 | 299 | COMInstallCommand install({}); |
293 | 300 | REQUIRE_NOTHROW(install.Execute(context)); |
| 301 | + |
| 302 | + REQUIRE(context.GetTerminationHR() == S_OK); |
| 303 | + |
| 304 | + // Verify installers are called in order |
| 305 | + REQUIRE(installationOrder.size() == 3); |
| 306 | + REQUIRE(installationOrder.at(0) == "Dependency1"); |
| 307 | + REQUIRE(installationOrder.at(1) == "Dependency2"); |
| 308 | + REQUIRE(installationOrder.at(2) == "AppInstallerCliTest.TestExeInstaller.MultipleDependencies"); |
294 | 309 | } |
295 | 310 |
|
296 | 311 | // TODO: |
|
0 commit comments