|
3 | 3 | #include "pch.h" |
4 | 4 | #include "WorkflowCommon.h" |
5 | 5 | #include "DependenciesTestSource.h" |
| 6 | +#include <AppInstallerRuntime.h> |
6 | 7 | #include <Commands/InstallCommand.h> |
7 | 8 | #include <Commands/COMCommand.h> |
8 | 9 | #include <Workflows/DependenciesFlow.h> |
@@ -328,6 +329,42 @@ TEST_CASE("InstallFlow_Dependencies_COM", "[InstallFlow][workflow][dependencies] |
328 | 329 | REQUIRE(installationOrder.at(2) == "AppInstallerCliTest.TestExeInstaller.MultipleDependencies"); |
329 | 330 | } |
330 | 331 |
|
| 332 | +void InstallFlow_Dependencies_WindowsFeaturesArgument_Generic(std::string_view featureName) |
| 333 | +{ |
| 334 | + std::ostringstream installOutput; |
| 335 | + TestContext context{ installOutput, std::cin }; |
| 336 | + |
| 337 | + context << ShellExecuteEnableWindowsFeature(featureName); |
| 338 | + |
| 339 | + INFO(installOutput.str()); |
| 340 | + |
| 341 | + REQUIRE(context.Contains(Execution::Data::OperationReturnCode)); |
| 342 | + REQUIRE(context.Get<Execution::Data::OperationReturnCode>() == E_INVALIDARG); |
| 343 | +} |
| 344 | + |
| 345 | +TEST_CASE("InstallFlow_Dependencies_WindowsFeaturesArgument_Extras", "[InstallFlow][workflow][dependencies][111981]") |
| 346 | +{ |
| 347 | + TempFile potentialLogFile("dism-log", ".log"); |
| 348 | + std::string featureName = "MediaPlayback /LogPath:"; |
| 349 | + featureName.append(potentialLogFile.GetPath().u8string()); |
| 350 | + |
| 351 | + InstallFlow_Dependencies_WindowsFeaturesArgument_Generic(featureName); |
| 352 | + |
| 353 | + REQUIRE(!std::filesystem::exists(potentialLogFile)); |
| 354 | +} |
| 355 | + |
| 356 | +TEST_CASE("InstallFlow_Dependencies_WindowsFeaturesArgument_Quoted", "[InstallFlow][workflow][dependencies][111981]") |
| 357 | +{ |
| 358 | + TempFile potentialLogFile("dism-log", ".log"); |
| 359 | + std::string featureName = "\"MediaPlayback /LogPath:"; |
| 360 | + featureName.append(potentialLogFile.GetPath().u8string()); |
| 361 | + featureName.append("\""); |
| 362 | + |
| 363 | + InstallFlow_Dependencies_WindowsFeaturesArgument_Generic(featureName); |
| 364 | + |
| 365 | + REQUIRE(!std::filesystem::exists(potentialLogFile)); |
| 366 | +} |
| 367 | + |
331 | 368 | // TODO: |
332 | 369 | // add dependencies for installer tests to DependenciesTestSource (or a new one) |
333 | 370 | // add tests for min version dependency solving |
|
0 commit comments