|
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> |
@@ -306,6 +307,42 @@ TEST_CASE("InstallFlow_Dependencies_COM", "[InstallFlow][workflow][dependencies] |
306 | 307 | REQUIRE(installationOrder.at(2) == "AppInstallerCliTest.TestExeInstaller.MultipleDependencies"); |
307 | 308 | } |
308 | 309 |
|
| 310 | +void InstallFlow_Dependencies_WindowsFeaturesArgument_Generic(std::string_view featureName) |
| 311 | +{ |
| 312 | + std::ostringstream installOutput; |
| 313 | + TestContext context{ installOutput, std::cin }; |
| 314 | + |
| 315 | + context << ShellExecuteEnableWindowsFeature(featureName); |
| 316 | + |
| 317 | + INFO(installOutput.str()); |
| 318 | + |
| 319 | + REQUIRE(context.Contains(Execution::Data::OperationReturnCode)); |
| 320 | + REQUIRE(context.Get<Execution::Data::OperationReturnCode>() == E_INVALIDARG); |
| 321 | +} |
| 322 | + |
| 323 | +TEST_CASE("InstallFlow_Dependencies_WindowsFeaturesArgument_Extras", "[InstallFlow][workflow][dependencies][111981]") |
| 324 | +{ |
| 325 | + TempFile potentialLogFile("dism-log", ".log"); |
| 326 | + std::string featureName = "MediaPlayback /LogPath:"; |
| 327 | + featureName.append(potentialLogFile.GetPath().u8string()); |
| 328 | + |
| 329 | + InstallFlow_Dependencies_WindowsFeaturesArgument_Generic(featureName); |
| 330 | + |
| 331 | + REQUIRE(!std::filesystem::exists(potentialLogFile)); |
| 332 | +} |
| 333 | + |
| 334 | +TEST_CASE("InstallFlow_Dependencies_WindowsFeaturesArgument_Quoted", "[InstallFlow][workflow][dependencies][111981]") |
| 335 | +{ |
| 336 | + TempFile potentialLogFile("dism-log", ".log"); |
| 337 | + std::string featureName = "\"MediaPlayback /LogPath:"; |
| 338 | + featureName.append(potentialLogFile.GetPath().u8string()); |
| 339 | + featureName.append("\""); |
| 340 | + |
| 341 | + InstallFlow_Dependencies_WindowsFeaturesArgument_Generic(featureName); |
| 342 | + |
| 343 | + REQUIRE(!std::filesystem::exists(potentialLogFile)); |
| 344 | +} |
| 345 | + |
309 | 346 | // TODO: |
310 | 347 | // add dependencies for installer tests to DependenciesTestSource (or a new one) |
311 | 348 | // add tests for min version dependency solving |
|
0 commit comments