summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2025-02-14 23:49:12 -0500
committerBob Arnson <github@bobs.org>2025-03-03 14:25:07 -0500
commitae96ff06cadd0141f48d88a7e9983ca81dace613 (patch)
tree692c21c53be97e30e60a515b215342b27a7087d0 /src/internal
parentca6e44d496b0c589fdaabad69a00643f539c47cd (diff)
downloadwix-ae96ff06cadd0141f48d88a7e9983ca81dace613.tar.gz
wix-ae96ff06cadd0141f48d88a7e9983ca81dace613.tar.bz2
wix-ae96ff06cadd0141f48d88a7e9983ca81dace613.zip
Convert tools\ to MSTest and traversal projects.
Diffstat (limited to '')
-rw-r--r--src/internal/WixInternal.MSTestSupport/MsbuildUtilities.cs8
-rw-r--r--src/internal/WixInternal.MSTestSupport/WixAssert.cs14
2 files changed, 15 insertions, 7 deletions
diff --git a/src/internal/WixInternal.MSTestSupport/MsbuildUtilities.cs b/src/internal/WixInternal.MSTestSupport/MsbuildUtilities.cs
index 4776e6f1..8f3fecd9 100644
--- a/src/internal/WixInternal.MSTestSupport/MsbuildUtilities.cs
+++ b/src/internal/WixInternal.MSTestSupport/MsbuildUtilities.cs
@@ -16,7 +16,7 @@ namespace WixInternal.MSTestSupport
16 16
17 public static class MsbuildUtilities 17 public static class MsbuildUtilities
18 { 18 {
19 public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", string verbosityLevel = "normal", bool suppressValidation = true) 19 public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", string verbosityLevel = "normal", bool suppressValidation = true, bool binlog = true)
20 { 20 {
21 var allArgs = new List<string> 21 var allArgs = new List<string>
22 { 22 {
@@ -26,9 +26,13 @@ namespace WixInternal.MSTestSupport
26 // Node reuse means that child msbuild processes can stay around after the build completes. 26 // Node reuse means that child msbuild processes can stay around after the build completes.
27 // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. 27 // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang.
28 "-nr:false", 28 "-nr:false",
29 MsbuildUtilities.GetQuotedSwitch(buildSystem, "bl", Path.ChangeExtension(projectPath, ".binlog"))
30 }; 29 };
31 30
31 if (binlog)
32 {
33 MsbuildUtilities.GetQuotedSwitch(buildSystem, "bl", Path.ChangeExtension(projectPath, ".binlog"));
34 }
35
32 if (arguments != null) 36 if (arguments != null)
33 { 37 {
34 allArgs.AddRange(arguments); 38 allArgs.AddRange(arguments);
diff --git a/src/internal/WixInternal.MSTestSupport/WixAssert.cs b/src/internal/WixInternal.MSTestSupport/WixAssert.cs
index 927ebee6..b4c59fa5 100644
--- a/src/internal/WixInternal.MSTestSupport/WixAssert.cs
+++ b/src/internal/WixInternal.MSTestSupport/WixAssert.cs
@@ -77,15 +77,19 @@ namespace WixInternal.MSTestSupport
77 Assert.AreNotEqual(expected, actual, comparer); 77 Assert.AreNotEqual(expected, actual, comparer);
78 } 78 }
79 79
80 public static void Single<T>(IEnumerable<T> collection) 80 public static T Single<T>(IEnumerable<T> collection)
81 { 81 {
82 Assert.AreEqual(1, collection.Count()); 82 return collection.Single();
83 } 83 }
84 84
85 public static void Single<T>(IEnumerable<T> collection, Func<T, bool> predicate) 85 public static T Single<T>(IEnumerable<T> collection, Func<T, bool> predicate)
86 { 86 {
87 var results = collection.Where(predicate); 87 return collection.Where(predicate).Single();
88 Assert.AreEqual(1, results.Count()); 88 }
89
90 public static void All<T>(IEnumerable<T> collection, Func<T, bool> predicate)
91 {
92 Assert.IsTrue(collection.All(predicate));
89 } 93 }
90 94
91 public static void Empty<T>(IEnumerable<T> collection) 95 public static void Empty<T>(IEnumerable<T> collection)