summaryrefslogtreecommitdiff
path: root/src/test/burn/WixTestTools
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/burn/WixTestTools')
-rw-r--r--src/test/burn/WixTestTools/BundleInstaller.cs8
-rw-r--r--src/test/burn/WixTestTools/TestTool.cs12
2 files changed, 16 insertions, 4 deletions
diff --git a/src/test/burn/WixTestTools/BundleInstaller.cs b/src/test/burn/WixTestTools/BundleInstaller.cs
index 0ab02d1b..5551d3c0 100644
--- a/src/test/burn/WixTestTools/BundleInstaller.cs
+++ b/src/test/burn/WixTestTools/BundleInstaller.cs
@@ -26,6 +26,10 @@ namespace WixTestTools
26 26
27 public string TestName { get; } 27 public string TestName { get; }
28 28
29 public int? AlternateExitCode { get; set; }
30
31 public int? LastExitCode { get; set; }
32
29 /// <summary> 33 /// <summary>
30 /// Runs the bundle asking for help. 34 /// Runs the bundle asking for help.
31 /// </summary> 35 /// </summary>
@@ -226,7 +230,9 @@ namespace WixTestTools
226 230
227 // Run the tool and assert the expected code. 231 // Run the tool and assert the expected code.
228 bundle.ExpectedExitCode = expectedExitCode; 232 bundle.ExpectedExitCode = expectedExitCode;
229 bundle.Run(assertOnError); 233 bundle.AlternateExitCode = this.AlternateExitCode;
234 var result = bundle.Run(assertOnError);
235 this.LastExitCode = result.ExitCode;
230 236
231 // Return the log file name. 237 // Return the log file name.
232 return logFile; 238 return logFile;
diff --git a/src/test/burn/WixTestTools/TestTool.cs b/src/test/burn/WixTestTools/TestTool.cs
index 9c3a3ea6..eb77c75b 100644
--- a/src/test/burn/WixTestTools/TestTool.cs
+++ b/src/test/burn/WixTestTools/TestTool.cs
@@ -30,6 +30,11 @@ namespace WixTestTools
30 } 30 }
31 31
32 /// <summary> 32 /// <summary>
33 /// The alternate expected exit code of the tool
34 /// </summary>
35 public int? AlternateExitCode { get; set; }
36
37 /// <summary>
33 /// The arguments to pass to the tool 38 /// The arguments to pass to the tool
34 /// </summary> 39 /// </summary>
35 public virtual string Arguments { get; set; } 40 public virtual string Arguments { get; set; }
@@ -139,12 +144,13 @@ namespace WixTestTools
139 List<string> errors = new List<string>(); 144 List<string> errors = new List<string>();
140 145
141 // Verify that the expected return code matched the actual return code 146 // Verify that the expected return code matched the actual return code
142 if (null != this.ExpectedExitCode && this.ExpectedExitCode != result.ExitCode) 147 if (null != this.ExpectedExitCode && this.ExpectedExitCode != result.ExitCode &&
148 (null == this.AlternateExitCode || this.AlternateExitCode != result.ExitCode))
143 { 149 {
144 errors.Add(String.Format("Expected exit code {0} did not match actual exit code {1}", this.ExpectedExitCode, result.ExitCode)); 150 errors.Add(String.Format("Expected exit code {0} did not match actual exit code {1}", this.ExpectedExitCode, result.ExitCode));
145 } 151 }
146 152
147 var standardErrorString = string.Join(Environment.NewLine, result.StandardError); 153 var standardErrorString = String.Join(Environment.NewLine, result.StandardError);
148 154
149 // Verify that the expected error string are in stderr 155 // Verify that the expected error string are in stderr
150 if (null != this.ExpectedErrorStrings) 156 if (null != this.ExpectedErrorStrings)
@@ -158,7 +164,7 @@ namespace WixTestTools
158 } 164 }
159 } 165 }
160 166
161 var standardOutputString = string.Join(Environment.NewLine, result.StandardOutput); 167 var standardOutputString = String.Join(Environment.NewLine, result.StandardOutput);
162 168
163 // Verify that the expected output string are in stdout 169 // Verify that the expected output string are in stdout
164 if (null != this.ExpectedOutputStrings) 170 if (null != this.ExpectedOutputStrings)