aboutsummaryrefslogtreecommitdiff
path: root/src/WixTestTools
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-03-11 20:57:52 -0600
committerSean Hall <r.sean.hall@gmail.com>2021-03-11 21:17:20 -0600
commit7cc4271c9d78ed60e354f585d03b612a9efb7cf3 (patch)
treed4694d54b757093093223fb8291933713585ab8b /src/WixTestTools
parent81908a5ec1647d76b45f50e4a18c37e1544818be (diff)
downloadwix-7cc4271c9d78ed60e354f585d03b612a9efb7cf3.tar.gz
wix-7cc4271c9d78ed60e354f585d03b612a9efb7cf3.tar.bz2
wix-7cc4271c9d78ed60e354f585d03b612a9efb7cf3.zip
Add tests to verify #4991 and #5702.
Diffstat (limited to 'src/WixTestTools')
-rw-r--r--src/WixTestTools/BundleInstaller.cs12
-rw-r--r--src/WixTestTools/BundleVerifier.cs14
-rw-r--r--src/WixTestTools/WixTestTools.csproj4
3 files changed, 28 insertions, 2 deletions
diff --git a/src/WixTestTools/BundleInstaller.cs b/src/WixTestTools/BundleInstaller.cs
index 854c12f0..859656ad 100644
--- a/src/WixTestTools/BundleInstaller.cs
+++ b/src/WixTestTools/BundleInstaller.cs
@@ -37,6 +37,18 @@ namespace WixTestTools
37 } 37 }
38 38
39 /// <summary> 39 /// <summary>
40 /// Installs the bundle with optional arguments.
41 /// </summary>
42 /// <param name="bundlePath">This should be the bundle in the package cache.</param>
43 /// <param name="expectedExitCode">Expected exit code, defaults to success.</param>
44 /// <param name="arguments">Optional arguments to pass to the tool.</param>
45 /// <returns>Path to the generated log file.</returns>
46 public string Install(string bundlePath, int expectedExitCode = (int)MSIExec.MSIExecReturnCode.SUCCESS, params string[] arguments)
47 {
48 return this.RunBundleWithArguments(expectedExitCode, MSIExec.MSIExecMode.Install, arguments, bundlePath: bundlePath);
49 }
50
51 /// <summary>
40 /// Modify the bundle with optional arguments. 52 /// Modify the bundle with optional arguments.
41 /// </summary> 53 /// </summary>
42 /// <param name="expectedExitCode">Expected exit code, defaults to success.</param> 54 /// <param name="expectedExitCode">Expected exit code, defaults to success.</param>
diff --git a/src/WixTestTools/BundleVerifier.cs b/src/WixTestTools/BundleVerifier.cs
index 433b6a0a..293da560 100644
--- a/src/WixTestTools/BundleVerifier.cs
+++ b/src/WixTestTools/BundleVerifier.cs
@@ -56,6 +56,20 @@ namespace WixTestTools
56 return Path.Combine(cachePath, Path.GetFileName(this.Bundle)); 56 return Path.Combine(cachePath, Path.GetFileName(this.Bundle));
57 } 57 }
58 58
59 public string ManuallyCache()
60 {
61 var expectedCachePath = this.GetExpectedCachedBundlePath();
62 Directory.CreateDirectory(Path.GetDirectoryName(expectedCachePath));
63 File.Copy(this.Bundle, expectedCachePath);
64 return expectedCachePath;
65 }
66
67 public void ManuallyUncache()
68 {
69 var expectedCachePath = this.GetExpectedCachedBundlePath();
70 File.Delete(expectedCachePath);
71 }
72
59 public bool TryGetRegistration(out BundleRegistration registration) 73 public bool TryGetRegistration(out BundleRegistration registration)
60 { 74 {
61 var bundleSymbol = this.GetBundleSymbol(); 75 var bundleSymbol = this.GetBundleSymbol();
diff --git a/src/WixTestTools/WixTestTools.csproj b/src/WixTestTools/WixTestTools.csproj
index 0c3c4c76..38b2cb35 100644
--- a/src/WixTestTools/WixTestTools.csproj
+++ b/src/WixTestTools/WixTestTools.csproj
@@ -11,8 +11,8 @@
11 <PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" /> 11 <PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
12 <PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" /> 12 <PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
13 <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.48" /> 13 <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.48" />
14 <PackageReference Include="WixToolset.Data" Version="4.0.198" /> 14 <PackageReference Include="WixToolset.Data" Version="4.0.199" />
15 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.51" /> 15 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.52" />
16 </ItemGroup> 16 </ItemGroup>
17 17
18 <ItemGroup> 18 <ItemGroup>