From ca6e44d496b0c589fdaabad69a00643f539c47cd Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 14 Feb 2025 22:29:39 -0500 Subject: Convert ext\ to MSTest and traversal projects. - Move ext\ unit tests to MSTest. - MSBuildify ext projects with MSTest execution. - Fork test support projects for MSTest: - WixInternal.TestSupport - WixInternal.Core.TestPackage --- src/ext/Bal/bal.cmd | 55 ------------- src/ext/Bal/bal_t.proj | 33 ++++++-- .../BalExtensionFixture.cs | 49 +++++------ .../InternalUIBAFixture.cs | 95 +++++++++++----------- .../WixToolsetTest.BootstrapperApplications.csproj | 7 +- src/ext/ComPlus/complus.cmd | 21 ----- src/ext/ComPlus/complus_t.proj | 17 ++++ .../ComPlusExtensionFixture.cs | 9 +- .../WixToolsetTest.ComPlus.csproj | 7 +- src/ext/Dependency/dependency.cmd | 21 ----- src/ext/Dependency/dependency_t.proj | 17 ++++ .../DependencyExtensionFixture.cs | 9 +- .../WixToolsetTest.Dependency.csproj | 7 +- src/ext/DirectX/directx.cmd | 24 ------ src/ext/DirectX/directx_t.proj | 17 ++++ .../DirectXExtensionFixture.cs | 9 +- .../WixToolsetTest.DirectX.csproj | 7 +- src/ext/Firewall/firewall.cmd | 21 ----- src/ext/Firewall/firewall_t.proj | 17 ++++ .../FirewallExtensionFixture.cs | 61 +++++++------- .../WixToolsetTest.Firewall.csproj | 7 +- src/ext/Http/http.cmd | 21 ----- src/ext/Http/http_t.proj | 17 ++++ .../WixToolsetTest.Http/HttpExtensionFixture.cs | 11 +-- .../WixToolsetTest.Http/WixToolsetTest.Http.csproj | 7 +- src/ext/Iis/iis.cmd | 21 ----- src/ext/Iis/iis_t.proj | 17 ++++ .../test/WixToolsetTest.Iis/IisExtensionFixture.cs | 9 +- .../WixToolsetTest.Iis/WixToolsetTest.Iis.csproj | 7 +- src/ext/Msmq/msmq.cmd | 21 ----- src/ext/Msmq/msmq_t.proj | 17 ++++ .../WixToolsetTest.Msmq/MsmqExtensionFixture.cs | 12 +-- .../WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj | 7 +- src/ext/NetFx/netfx.cmd | 48 ----------- src/ext/NetFx/netfx_t.proj | 26 ++++++ .../WixToolsetTest.Netfx/NetfxExtensionFixture.cs | 67 +++++---------- .../WixToolsetTest.Netfx.csproj | 7 +- src/ext/PowerShell/powershell_t.proj | 17 ++++ src/ext/PowerShell/ps.cmd | 21 ----- .../PowerShellExtensionFixture.cs | 13 +-- .../WixToolsetTest.Powershell.csproj | 7 +- src/ext/Sql/sql.cmd | 21 ----- src/ext/Sql/sql_t.proj | 17 ++++ .../test/WixToolsetTest.Sql/SqlExtensionFixture.cs | 9 +- .../WixToolsetTest.Sql/WixToolsetTest.Sql.csproj | 7 +- .../test/WixToolsetTest.UI/UIExtensionFixture.cs | 89 ++++++++++---------- .../WixToolsetTest.UI/WixToolsetTest.UI.csproj | 7 +- src/ext/UI/ui.cmd | 42 ---------- src/ext/UI/ui_t.proj | 17 ++++ .../WixToolsetTest.Util/UtilExtensionFixture.cs | 61 +++++++------- .../WixToolsetTest.Util/WixToolsetTest.Util.csproj | 7 +- src/ext/Util/util.cmd | 45 ---------- src/ext/Util/util_t.proj | 17 ++++ .../VisualStudioExtensionFixture.cs | 11 +-- .../WixToolsetTest.VisualStudio.csproj | 7 +- src/ext/VisualStudio/visualstudio_t.proj | 17 ++++ src/ext/VisualStudio/vs.cmd | 21 ----- src/ext/ext.cmd | 53 ++---------- src/ext/ext_t.proj | 30 +++++++ 59 files changed, 597 insertions(+), 764 deletions(-) delete mode 100644 src/ext/Bal/bal.cmd delete mode 100644 src/ext/ComPlus/complus.cmd create mode 100644 src/ext/ComPlus/complus_t.proj delete mode 100644 src/ext/Dependency/dependency.cmd create mode 100644 src/ext/Dependency/dependency_t.proj delete mode 100644 src/ext/DirectX/directx.cmd create mode 100644 src/ext/DirectX/directx_t.proj delete mode 100644 src/ext/Firewall/firewall.cmd create mode 100644 src/ext/Firewall/firewall_t.proj delete mode 100644 src/ext/Http/http.cmd create mode 100644 src/ext/Http/http_t.proj delete mode 100644 src/ext/Iis/iis.cmd create mode 100644 src/ext/Iis/iis_t.proj delete mode 100644 src/ext/Msmq/msmq.cmd create mode 100644 src/ext/Msmq/msmq_t.proj delete mode 100644 src/ext/NetFx/netfx.cmd create mode 100644 src/ext/NetFx/netfx_t.proj create mode 100644 src/ext/PowerShell/powershell_t.proj delete mode 100644 src/ext/PowerShell/ps.cmd delete mode 100644 src/ext/Sql/sql.cmd create mode 100644 src/ext/Sql/sql_t.proj delete mode 100644 src/ext/UI/ui.cmd create mode 100644 src/ext/UI/ui_t.proj delete mode 100644 src/ext/Util/util.cmd create mode 100644 src/ext/Util/util_t.proj create mode 100644 src/ext/VisualStudio/visualstudio_t.proj delete mode 100644 src/ext/VisualStudio/vs.cmd create mode 100644 src/ext/ext_t.proj (limited to 'src/ext') diff --git a/src/ext/Bal/bal.cmd b/src/ext/Bal/bal.cmd deleted file mode 100644 index df9ceca4..00000000 --- a/src/ext/Bal/bal.cmd +++ /dev/null @@ -1,55 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -@set _L=%~dp0..\..\..\build\logs - -:parse_args -@if /i "%1"=="release" set _C=Release -@if /i "%1"=="inc" set _INC=1 -@if /i "%1"=="clean" set _CLEAN=1 -@if not "%1"=="" shift & goto parse_args - -@set _B=%~dp0..\..\..\build\Bal.wixext\%_C% - -:: Clean - -@if "%_INC%"=="" call :clean -@if NOT "%_CLEAN%"=="" goto :end - -@echo Building ext\Bal %_C% using %_N% - -:: Restore -:: Build -:: Pack -:: Note: This test project must be restored and built directly to get all its support files laid out correctly. -:: Everything else is built by the traversal project. -msbuild -Restore -p:Configuration=%_C% -tl -nologo -m -warnaserror test\WixToolsetTest.BootstrapperApplications\WixToolsetTest.BootstrapperApplications.csproj -bl:%_L%\ext_bal_build.binlog || exit /b - -msbuild bal_t.proj -p:Configuration=%_C% -tl -nologo -warnaserror -bl:%_L%\bal_build.binlog || exit /b - -:: Test -dotnet test ^ - %_B%\x86\WixStdFnUnitTest.dll ^ - %_B%\net6.0\WixToolsetTest.BootstrapperApplications.dll ^ - --nologo -l "trx;LogFileName=%_L%\TestResults\bal.wixext.trx" || exit /b - -@goto :end - -:clean -@rd /s/q "..\..\..\build\Bal.wixext" 2> nul -@del "..\..\..\build\artifacts\WixToolset.Bal.wixext.*.nupkg" 2> nul -@del "..\..\..\build\artifacts\WixToolset.BootstrapperApplications.wixext.*.nupkg" 2> nul -@del "..\..\..\build\artifacts\WixToolset.WixStandardBootstrapperApplicationFunctionApi.*.nupkg" 2> nul -@del "%_L%\ext_bal_build.binlog" 2> nul -@del "%_L%\bal_fnsapi_build.binlog" 2> nul -@del "%_L%\bal_examples_build.binlog" 2> nul -@del "%_L%\TestResults\bal.wixext.trx" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.bal.wixext" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.bootstrapperapplications.wixext" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.wixstandardbootstrapperapplicationfunctionapi" 2> nul -@exit /b - -:end -@popd -@endlocal diff --git a/src/ext/Bal/bal_t.proj b/src/ext/Bal/bal_t.proj index a0e66e97..da83b47f 100644 --- a/src/ext/Bal/bal_t.proj +++ b/src/ext/Bal/bal_t.proj @@ -3,13 +3,6 @@ - - - - - - - @@ -17,11 +10,33 @@ - + - + + + + + + + + + + + + + + + + + + diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs index 2e21ef90..6e24ad72 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs @@ -6,13 +6,14 @@ namespace WixToolsetTest.BootstrapperApplications using System.Collections.Generic; using System.IO; using System.Linq; - using WixInternal.Core.TestPackage; - using WixInternal.TestSupport; - using Xunit; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.Core.MSTestPackage; + using WixInternal.MSTestSupport; + [TestClass] public class BalExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingDisplayInternalUICondition() { using (var fs = new DisposableFileSystem()) @@ -35,7 +36,7 @@ namespace WixToolsetTest.BootstrapperApplications }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -46,11 +47,11 @@ namespace WixToolsetTest.BootstrapperApplications "", }, balPackageInfos); - Assert.True(File.Exists(Path.Combine(baFolderPath, "thm.wxl"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "thm.wxl"))); } } - [Fact] + [TestMethod] public void CanBuildUsingBootstrapperApplicationId() { using (var fs = new DisposableFileSystem()) @@ -73,7 +74,7 @@ namespace WixToolsetTest.BootstrapperApplications }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -91,7 +92,7 @@ namespace WixToolsetTest.BootstrapperApplications } } - [Fact] + [TestMethod] public void CanBuildUsingOverridable() { using (var fs = new DisposableFileSystem()) @@ -113,7 +114,7 @@ namespace WixToolsetTest.BootstrapperApplications }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -132,7 +133,7 @@ namespace WixToolsetTest.BootstrapperApplications } } - [Fact] + [TestMethod] public void CanBuildUsingWixStdBa() { using (var fs = new DisposableFileSystem()) @@ -152,11 +153,11 @@ namespace WixToolsetTest.BootstrapperApplications }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); } } - //[Fact] + // [TestMethod] //public void CanBuildUsingMBAWithAlwaysInstallPrereqs() //{ // using (var fs = new DisposableFileSystem()) @@ -179,7 +180,7 @@ namespace WixToolsetTest.BootstrapperApplications // compileResult.AssertSuccess(); - // Assert.True(File.Exists(bundleFile)); + // Assert.IsTrue(File.Exists(bundleFile)); // var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); // extractResult.AssertSuccess(); @@ -198,7 +199,7 @@ namespace WixToolsetTest.BootstrapperApplications // } //} - [Fact] + [TestMethod] public void CannotBuildUsingMBAWithNoPrereqs() { using (var fs = new DisposableFileSystem()) @@ -223,14 +224,14 @@ namespace WixToolsetTest.BootstrapperApplications { "The WixManagedBootstrapperApplicationHost element has been deprecated.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(1130, compileResult.ExitCode); + Assert.AreEqual(1130, compileResult.ExitCode); - Assert.False(File.Exists(bundleFile)); - Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); + Assert.IsFalse(File.Exists(bundleFile)); + Assert.IsFalse(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); } } - [Fact] + [TestMethod] public void CannotBuildUsingDncbaMissingBAFactoryPayload() { using (var fs = new DisposableFileSystem()) @@ -254,14 +255,14 @@ namespace WixToolsetTest.BootstrapperApplications "The WixDotNetCoreBootstrapperApplicationHost element has been deprecated.", "The BootstrapperApplication element's Name or SourceFile attribute was not found; one of these is required." }, compileResult.Messages.Select(x => x.ToString()).ToArray()); - Assert.Equal(44, compileResult.ExitCode); + Assert.AreEqual(44, compileResult.ExitCode); - Assert.False(File.Exists(bundleFile)); - Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); + Assert.IsFalse(File.Exists(bundleFile)); + Assert.IsFalse(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); } } - [Fact] + [TestMethod] public void CannotBuildUsingOverridableWrongCase() { using (var fs = new DisposableFileSystem()) @@ -284,7 +285,7 @@ namespace WixToolsetTest.BootstrapperApplications "-o", bundleFile, }); - Assert.InRange(result.ExitCode, 2, Int32.MaxValue); + Assert.IsTrue(result.ExitCode >= 2 && result.ExitCode <= Int32.MaxValue); var messages = result.Messages.Select(m => m.ToString()).ToList(); messages.Sort(); diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs index 58d5d551..72e31540 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs @@ -5,13 +5,14 @@ namespace WixToolsetTest.BootstrapperApplications using System.IO; using System.Linq; using System.Xml; - using WixInternal.Core.TestPackage; - using WixInternal.TestSupport; - using Xunit; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.Core.MSTestPackage; + using WixInternal.MSTestSupport; + [TestClass] public class InternalUIBAFixture { - [Fact] + [TestMethod] public void CanBuildUsingWixIuiBa() { using (var fs = new DisposableFileSystem()) @@ -34,7 +35,7 @@ namespace WixToolsetTest.BootstrapperApplications }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -45,12 +46,12 @@ namespace WixToolsetTest.BootstrapperApplications "", }, balPackageInfos); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); } } - [Fact] + [TestMethod] public void CanBuildUsingWixIuiBaWithUrlPrereqPackage() { using (var fs = new DisposableFileSystem()) @@ -73,7 +74,7 @@ namespace WixToolsetTest.BootstrapperApplications }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -90,12 +91,12 @@ namespace WixToolsetTest.BootstrapperApplications "", }, mbaPrereqInfos); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); } } - [Fact] + [TestMethod] public void CanBuildUsingWixIuiBaWithImplicitPrimaryPackage() { using (var fs = new DisposableFileSystem()) @@ -118,7 +119,7 @@ namespace WixToolsetTest.BootstrapperApplications }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -135,12 +136,12 @@ namespace WixToolsetTest.BootstrapperApplications "", }, mbaPrereqInfos); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); } } - [Fact] + [TestMethod] public void CanBuildUsingWixIuiBaWithWarnings() { using (var fs = new DisposableFileSystem()) @@ -172,7 +173,7 @@ namespace WixToolsetTest.BootstrapperApplications compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -189,12 +190,12 @@ namespace WixToolsetTest.BootstrapperApplications "", }, mbaPrereqInfos); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); } } - [Fact] + [TestMethod] public void CanBuildUsingWixIuiBaAndForcedCachePrimaryPackage() { using (var fs = new DisposableFileSystem()) @@ -218,7 +219,7 @@ namespace WixToolsetTest.BootstrapperApplications compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -239,8 +240,8 @@ namespace WixToolsetTest.BootstrapperApplications "", }, mbaPrereqInfos); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); - Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); + Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); } static void AssertCacheType(XmlNode node) @@ -251,16 +252,16 @@ namespace WixToolsetTest.BootstrapperApplications if (package == "test.msi") { - Assert.Equal("force", cache); + Assert.AreEqual("force", cache); } else if (package == "wixnative.exe") { - Assert.Equal("keep", cache); + Assert.AreEqual("keep", cache); } } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithAllPrereqPackages() { using (var fs = new DisposableFileSystem()) @@ -285,11 +286,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\".", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6808, compileResult.ExitCode); + Assert.AreEqual(6808, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithImplicitNonMsiPrimaryPackage() { using (var fs = new DisposableFileSystem()) @@ -314,11 +315,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication, packages must either be non-permanent and have the bal:PrimaryPackageType attribute, or be permanent and have the bal:PrereqPackage attribute set to 'yes'.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6811, compileResult.ExitCode); + Assert.AreEqual(6811, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithImplicitPrimaryPackageEnableFeatureSelection() { using (var fs = new DisposableFileSystem()) @@ -343,11 +344,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication, packages must either be non-permanent and have the bal:PrimaryPackageType attribute, or be permanent and have the bal:PrereqPackage attribute set to 'yes'.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6811, compileResult.ExitCode); + Assert.AreEqual(6811, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithMultipleNonPermanentNonPrimaryPackages() { using (var fs = new DisposableFileSystem()) @@ -373,11 +374,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication, packages must either be non-permanent and have the bal:PrimaryPackageType attribute, or be permanent and have the bal:PrereqPackage attribute set to 'yes'.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6811, compileResult.ExitCode); + Assert.AreEqual(6811, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithMultiplePrimaryPackagesOfSameType() { using (var fs = new DisposableFileSystem()) @@ -403,11 +404,11 @@ namespace WixToolsetTest.BootstrapperApplications "The location of the package related to the previous error.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6810, compileResult.ExitCode); + Assert.AreEqual(6810, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithNoDefaultPrimaryPackage() { using (var fs = new DisposableFileSystem()) @@ -432,11 +433,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\".", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6808, compileResult.ExitCode); + Assert.AreEqual(6808, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithNonMsiPrimaryPackage() { using (var fs = new DisposableFileSystem()) @@ -461,11 +462,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication, each primary package must be an MsiPackage.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6814, compileResult.ExitCode); + Assert.AreEqual(6814, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithNonPermanentPrereqPackage() { using (var fs = new DisposableFileSystem()) @@ -490,11 +491,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication and bal:PrereqPackage is set to 'yes', the package must be permanent.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6812, compileResult.ExitCode); + Assert.AreEqual(6812, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithPermanentPrimaryPackage() { using (var fs = new DisposableFileSystem()) @@ -520,11 +521,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\".", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6808, compileResult.ExitCode); + Assert.AreEqual(6808, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithPrimaryPackageEnableFeatureSelection() { using (var fs = new DisposableFileSystem()) @@ -550,11 +551,11 @@ namespace WixToolsetTest.BootstrapperApplications "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\".", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(6808, compileResult.ExitCode); + Assert.AreEqual(6808, compileResult.ExitCode); } } - [Fact] + [TestMethod] public void CannotBuildUsingWixIuiBaWithPrimaryPrereqPackage() { using (var fs = new DisposableFileSystem()) @@ -578,7 +579,7 @@ namespace WixToolsetTest.BootstrapperApplications "The MsiPackage/@PrereqPackage attribute's value, 'yes', cannot be specified with attribute PrimaryPackageType present.", }, compileResult.Messages.Select(m => m.ToString()).ToArray()); - Assert.Equal(193, compileResult.ExitCode); + Assert.AreEqual(193, compileResult.ExitCode); } } } diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/WixToolsetTest.BootstrapperApplications.csproj b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/WixToolsetTest.BootstrapperApplications.csproj index 64fc297c..6a9b5856 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/WixToolsetTest.BootstrapperApplications.csproj +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/WixToolsetTest.BootstrapperApplications.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -20,6 +20,7 @@ - + + diff --git a/src/ext/ComPlus/complus.cmd b/src/ext/ComPlus/complus.cmd deleted file mode 100644 index 3b3a5772..00000000 --- a/src/ext/ComPlus/complus.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo ComPlus.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.ComPlus || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.ComPlus.wixext.csproj || exit /b - -@popd -@endlocal \ No newline at end of file diff --git a/src/ext/ComPlus/complus_t.proj b/src/ext/ComPlus/complus_t.proj new file mode 100644 index 00000000..439856b6 --- /dev/null +++ b/src/ext/ComPlus/complus_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/ComPlus/test/WixToolsetTest.ComPlus/ComPlusExtensionFixture.cs b/src/ext/ComPlus/test/WixToolsetTest.ComPlus/ComPlusExtensionFixture.cs index 17c5eb0f..7b38ef54 100644 --- a/src/ext/ComPlus/test/WixToolsetTest.ComPlus/ComPlusExtensionFixture.cs +++ b/src/ext/ComPlus/test/WixToolsetTest.ComPlus/ComPlusExtensionFixture.cs @@ -3,14 +3,15 @@ namespace WixToolsetTest.ComPlus { using System.Linq; - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.ComPlus; - using Xunit; + [TestClass] public class ComPlusExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingComPlusPartition() { var folder = TestData.Get(@"TestData\UsingComPlusPartition"); diff --git a/src/ext/ComPlus/test/WixToolsetTest.ComPlus/WixToolsetTest.ComPlus.csproj b/src/ext/ComPlus/test/WixToolsetTest.ComPlus/WixToolsetTest.ComPlus.csproj index a9e9dbef..d0a7081b 100644 --- a/src/ext/ComPlus/test/WixToolsetTest.ComPlus/WixToolsetTest.ComPlus.csproj +++ b/src/ext/ComPlus/test/WixToolsetTest.ComPlus/WixToolsetTest.ComPlus.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/Dependency/dependency.cmd b/src/ext/Dependency/dependency.cmd deleted file mode 100644 index 0ebcbfd5..00000000 --- a/src/ext/Dependency/dependency.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo Dependency.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.Dependency || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.Dependency.wixext.csproj || exit /b - -@popd -@endlocal diff --git a/src/ext/Dependency/dependency_t.proj b/src/ext/Dependency/dependency_t.proj new file mode 100644 index 00000000..d05b8de9 --- /dev/null +++ b/src/ext/Dependency/dependency_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs b/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs index 6190a4e0..ade2a12e 100644 --- a/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs +++ b/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs @@ -4,14 +4,15 @@ namespace WixToolsetTest.Dependency { using System.Linq; using System.Text.RegularExpressions; - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.Dependency; - using Xunit; + [TestClass] public class DependencyExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingProvides() { var folder = TestData.Get(@"TestData\UsingProvides"); diff --git a/src/ext/Dependency/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj b/src/ext/Dependency/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj index 70b56f45..1fd46c63 100644 --- a/src/ext/Dependency/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj +++ b/src/ext/Dependency/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/DirectX/directx.cmd b/src/ext/DirectX/directx.cmd deleted file mode 100644 index 56889513..00000000 --- a/src/ext/DirectX/directx.cmd +++ /dev/null @@ -1,24 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo DirectX.wixext build %_C% - -:: Restore -msbuild -t:Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Build -msbuild -t:Build -p:Configuration=%_C% -tl -nologo -warnaserror test\WixToolsetTest.DirectX\WixToolsetTest.DirectX.csproj || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.DirectX || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror wixext\WixToolset.DirectX.wixext.csproj || exit /b - -@popd -@endlocal diff --git a/src/ext/DirectX/directx_t.proj b/src/ext/DirectX/directx_t.proj new file mode 100644 index 00000000..17b147ef --- /dev/null +++ b/src/ext/DirectX/directx_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs b/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs index 64013ca6..dceaaec5 100644 --- a/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs +++ b/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs @@ -3,14 +3,15 @@ namespace WixToolsetTest.DirectX { using System.Linq; - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.DirectX; - using Xunit; + [TestClass] public class DirectXExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingPixelShaderVersion() { var folder = TestData.Get(@"TestData\UsingPixelShaderVersion"); diff --git a/src/ext/DirectX/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj b/src/ext/DirectX/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj index 31a35320..c13f3300 100644 --- a/src/ext/DirectX/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj +++ b/src/ext/DirectX/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -19,6 +19,7 @@ - + + diff --git a/src/ext/Firewall/firewall.cmd b/src/ext/Firewall/firewall.cmd deleted file mode 100644 index 92926a8c..00000000 --- a/src/ext/Firewall/firewall.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo Firewall.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.Firewall || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.Firewall.wixext.csproj || exit /b - -@popd -@endlocal diff --git a/src/ext/Firewall/firewall_t.proj b/src/ext/Firewall/firewall_t.proj new file mode 100644 index 00000000..67229c39 --- /dev/null +++ b/src/ext/Firewall/firewall_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs index 65016865..4b9aecd7 100644 --- a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs +++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs @@ -6,14 +6,15 @@ namespace WixToolsetTest.Firewall using System.IO; using System.Linq; using System.Xml.Linq; - using WixInternal.Core.TestPackage; - using WixInternal.TestSupport; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.Core.MSTestPackage; + using WixInternal.MSTestSupport; using WixToolset.Firewall; - using Xunit; + [TestClass] public class FirewallExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingFirewall() { var folder = TestData.Get(@"TestData\UsingFirewall"); @@ -52,7 +53,7 @@ namespace WixToolsetTest.Firewall }, results); } - [Fact] + [TestMethod] public void CanBuildUsingFirewallARM64() { var folder = TestData.Get(@"TestData\UsingFirewall"); @@ -91,7 +92,7 @@ namespace WixToolsetTest.Firewall }, results); } - [Fact] + [TestMethod] public void CanBuildWithProperties() { var folder = TestData.Get(@"TestData\UsingProperties"); @@ -112,7 +113,7 @@ namespace WixToolsetTest.Firewall }, results); } - [Fact] + [TestMethod] public void CanBuildWithPropertiesUsingFirewallARM64() { var folder = TestData.Get(@"TestData\UsingProperties"); @@ -133,7 +134,7 @@ namespace WixToolsetTest.Firewall }, results); } - [Fact] + [TestMethod] public void CanRoundtripFirewallExceptions() { var folder = TestData.Get(@"TestData", "UsingFirewall"); @@ -181,7 +182,7 @@ namespace WixToolsetTest.Firewall }, actual.Select(a => a.Name).ToArray()); } - [Fact] + [TestMethod] public void CanRoundtripFirewallExceptionsWithProperties() { var folder = TestData.Get(@"TestData", "UsingProperties"); @@ -212,7 +213,7 @@ namespace WixToolsetTest.Firewall }, actual.Select(a => a.Name).ToArray()); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForApp() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleApp"); @@ -230,7 +231,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForPort() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExamplePort"); @@ -248,7 +249,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForDNSScope() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDNSScope"); @@ -264,7 +265,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForDHCPScope() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDHCPScope"); @@ -281,7 +282,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForWINSScope() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleWINSScope"); @@ -298,7 +299,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForDefaultGatewayScope() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDefaultGatewayScope"); @@ -315,7 +316,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForINetFwRule3Values() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "INetFwRule3 values"); @@ -335,7 +336,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForINetFwRule3Properties() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "INetFwRule3 properties"); @@ -355,7 +356,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForGroupingValue() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "GroupingExample1"); @@ -370,7 +371,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForGroupingProperty() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "GroupingExample2"); @@ -386,7 +387,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForIcmpValue() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ICMPExample1"); @@ -401,7 +402,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForIcmpProperty() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ICMPExample2"); @@ -416,7 +417,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForLocalScopeValue() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "LocalScopeExample1"); @@ -431,7 +432,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForLocalScopeProperty() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "LocalScopeExample2"); @@ -446,7 +447,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForRemotePorts() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "RemotePortExample1"); @@ -462,7 +463,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectForRemotePortsProperty() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "RemotePortExample2"); @@ -478,7 +479,7 @@ namespace WixToolsetTest.Firewall }, actual.Attributes); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectWhenPropertiesAreUsed() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "[NAME]", "UsingProperties"); @@ -526,10 +527,10 @@ namespace WixToolsetTest.Firewall }); var nested = related.Select(e => e.Attributes().Single(a => a.Name.LocalName == "Name").Value); - Assert.False(nested.Any()); + Assert.IsFalse(nested.Any()); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectWhenNestedPropertiesAreUsed() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "Single Nested properties", "UsingProperties"); @@ -559,10 +560,10 @@ namespace WixToolsetTest.Firewall }); var nested = related.Select(e => e.Attributes().Single(a => a.Name.LocalName == "Name").Value); - Assert.False(nested.Any()); + Assert.IsFalse(nested.Any()); } - [Fact] + [TestMethod] public void RoundtripAttributesAreCorrectWhenMultipleNestedPropertiesAreUsed() { var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "Multiple Nested properties", "UsingProperties"); diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/WixToolsetTest.Firewall.csproj b/src/ext/Firewall/test/WixToolsetTest.Firewall/WixToolsetTest.Firewall.csproj index e46020a6..5de88c8b 100644 --- a/src/ext/Firewall/test/WixToolsetTest.Firewall/WixToolsetTest.Firewall.csproj +++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/WixToolsetTest.Firewall.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/Http/http.cmd b/src/ext/Http/http.cmd deleted file mode 100644 index afcffb24..00000000 --- a/src/ext/Http/http.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo Http.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.Http || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.Http.wixext.csproj || exit /b - -@popd -@endlocal diff --git a/src/ext/Http/http_t.proj b/src/ext/Http/http_t.proj new file mode 100644 index 00000000..8cd9c7d4 --- /dev/null +++ b/src/ext/Http/http_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs b/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs index ffd698f5..c91ce937 100644 --- a/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs +++ b/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs @@ -2,14 +2,15 @@ namespace WixToolsetTest.Http { - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.Http; - using Xunit; + [TestClass] public class HttpExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingSsl() { var folder = TestData.Get("TestData", "Ssl"); @@ -29,7 +30,7 @@ namespace WixToolsetTest.Http }, results); } - [Fact] + [TestMethod] public void CanBuildUsingUrlReservation() { var folder = TestData.Get(@"TestData\UsingUrlReservation"); diff --git a/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj b/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj index b23ef481..d5e6c929 100644 --- a/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj +++ b/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/Iis/iis.cmd b/src/ext/Iis/iis.cmd deleted file mode 100644 index 0ae87a77..00000000 --- a/src/ext/Iis/iis.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo Iis.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test test\WixToolsetTest.Iis -c %_C% --no-build --nologo || exit /b - -:: Pack -dotnet pack wixext\WixToolset.Iis.wixext.csproj -c %_C% --no-build --nologo || exit /b - -@popd -@endlocal diff --git a/src/ext/Iis/iis_t.proj b/src/ext/Iis/iis_t.proj new file mode 100644 index 00000000..84473475 --- /dev/null +++ b/src/ext/Iis/iis_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs b/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs index ab3f35d9..01a89dc0 100644 --- a/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs +++ b/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs @@ -3,14 +3,15 @@ namespace WixToolsetTest.Iis { using System.Linq; - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.Iis; - using Xunit; + [TestClass] public class IisExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingIIs() { var folder = TestData.Get(@"TestData\UsingIis"); diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj b/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj index a39e5b0b..a0a6e043 100644 --- a/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj +++ b/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -19,6 +19,7 @@ - + + diff --git a/src/ext/Msmq/msmq.cmd b/src/ext/Msmq/msmq.cmd deleted file mode 100644 index 3ebceab4..00000000 --- a/src/ext/Msmq/msmq.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo Msmq.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test test\WixToolsetTest.Msmq -c %_C% --no-build --nologo || exit /b - -:: Pack -dotnet pack wixext\WixToolset.Msmq.wixext.csproj -c %_C% --no-build --nologo || exit /b - -@popd -@endlocal diff --git a/src/ext/Msmq/msmq_t.proj b/src/ext/Msmq/msmq_t.proj new file mode 100644 index 00000000..73424370 --- /dev/null +++ b/src/ext/Msmq/msmq_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs b/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs index 970bc2e9..60335b8a 100644 --- a/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs +++ b/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs @@ -6,14 +6,15 @@ namespace WixToolsetTest.Msmq using System.IO; using System.Linq; using System.Xml.Linq; - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.Msmq; - using Xunit; + [TestClass] public class MsmqExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingMessageQueue() { var folder = TestData.Get(@"TestData\UsingMessageQueue"); @@ -36,7 +37,8 @@ namespace WixToolsetTest.Msmq }, results); } - [Fact(Skip = "Util:Wix4Group and Util:Wix6Group decompilation issues prevent this usage currently")] + [TestMethod] + [Ignore("Util:Wix4Group and Util:Wix6Group decompilation issues prevent this usage currently")] public void CanRoundtripMessageQueue() { var folder = TestData.Get(@"TestData\UsingMessageQueue"); diff --git a/src/ext/Msmq/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj b/src/ext/Msmq/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj index e7b6f21e..a8991c2e 100644 --- a/src/ext/Msmq/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj +++ b/src/ext/Msmq/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -19,6 +19,7 @@ - + + diff --git a/src/ext/NetFx/netfx.cmd b/src/ext/NetFx/netfx.cmd deleted file mode 100644 index d81959cc..00000000 --- a/src/ext/NetFx/netfx.cmd +++ /dev/null @@ -1,48 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -@set _L=%~dp0..\..\..\build\logs - -:parse_args -@if /i "%1"=="release" set _C=Release -@if /i "%1"=="inc" set _INC=1 -@if /i "%1"=="clean" set _CLEAN=1 -@if not "%1"=="" shift & goto parse_args - -@set _B=%~dp0..\..\..\build\NetFx.wixext\%_C% - -:: Clean - -@if "%_INC%"=="" call :clean -@if NOT "%_CLEAN%"=="" goto :end - -@echo NetFx.wixext build %_C% - -:: Restore -nuget restore netcoresearch\packages.config || exit /b - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror -bl:%_L%\ext_netfx_build.binlog || exit /b - -:: Test -dotnet test ^ - %_B%\net6.0\WixToolsetTest.NetFx.dll ^ - --nologo -l "trx;LogFileName=%_L%\TestResults\netfx.wixext.trx" || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.Netfx.wixext.csproj || exit /b - -@goto :end - -:clean -@rd /s/q "..\..\build\NetFx.wixext" 2> nul -@del "..\..\build\artifacts\WixToolset.NetFx.wixext.*.nupkg" 2> nul -@del "%_L%\ext_netfx_build.binlog" 2> nul -@del "%_L%\TestResults\netfx.wixext.trx" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.netfx.wixext" 2> nul -@exit /b - -:end -@popd -@endlocal diff --git a/src/ext/NetFx/netfx_t.proj b/src/ext/NetFx/netfx_t.proj new file mode 100644 index 00000000..3301dc8a --- /dev/null +++ b/src/ext/NetFx/netfx_t.proj @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs b/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs index a78a5617..37f715bf 100644 --- a/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs +++ b/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs @@ -4,14 +4,15 @@ namespace WixToolsetTest.Netfx { using System.IO; using System.Linq; - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.Netfx; - using Xunit; + [TestClass] public class NetfxExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingLatestDotNetCorePackages() { using (var fs = new DisposableFileSystem()) @@ -21,30 +22,24 @@ namespace WixToolsetTest.Netfx var bundleSourceFolder = TestData.Get(@"TestData\UsingDotNetCorePackages"); var intermediateFolder = Path.Combine(baseFolder, "obj"); - var extensionResult = WixRunner.Execute(new[] - { - "extension", "add", - "WixToolset.BootstrapperApplications.wixext" - }); - var compileResult = WixRunner.Execute(new[] { "build", Path.Combine(bundleSourceFolder, "BundleLatest.wxs"), Path.Combine(bundleSourceFolder, "NetCore3.1.12_x86.wxs"), Path.Combine(bundleSourceFolder, "NetCore3.1.12_x64.wxs"), - "-ext", "WixToolset.BootstrapperApplications.wixext", + "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll").Replace("NetFx.wixext", "Bal.wixext"), "-ext", TestData.Get(@"WixToolset.Netfx.wixext.dll"), "-intermediateFolder", intermediateFolder, "-o", bundleFile, }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); } } - [Fact] + [TestMethod] public void CanBuildUsingLatestDotNetCorePackages_X64() { using (var fs = new DisposableFileSystem()) @@ -54,29 +49,23 @@ namespace WixToolsetTest.Netfx var bundleSourceFolder = TestData.Get(@"TestData\UsingDotNetCorePackages"); var intermediateFolder = Path.Combine(baseFolder, "obj"); - var extensionResult = WixRunner.Execute(new[] - { - "extension", "add", - "WixToolset.BootstrapperApplications.wixext" - }); - var compileResult = WixRunner.Execute(new[] { "build", Path.Combine(bundleSourceFolder, "BundleLatest_x64.wxs"), Path.Combine(bundleSourceFolder, "NetCore3.1.12_x64.wxs"), - "-ext", "WixToolset.BootstrapperApplications.wixext", + "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll").Replace("NetFx.wixext", "Bal.wixext"), "-ext", TestData.Get(@"WixToolset.Netfx.wixext.dll"), "-intermediateFolder", intermediateFolder, "-o", bundleFile, }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); } } - [Fact] + [TestMethod] public void CanBuildUsingNetFx481Packages() { using (var fs = new DisposableFileSystem()) @@ -86,17 +75,11 @@ namespace WixToolsetTest.Netfx var bundleSourceFolder = TestData.Get(@"TestData\UsingNetFxPackages"); var intermediateFolder = Path.Combine(baseFolder, "obj"); - var extensionResult = WixRunner.Execute(new[] - { - "extension", "add", - "WixToolset.BootstrapperApplications.wixext" - }); - var compileResult = WixRunner.Execute(new[] { "build", Path.Combine(bundleSourceFolder, "BundleLatest.wxs"), - "-ext", "WixToolset.BootstrapperApplications.wixext", + "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll").Replace("NetFx.wixext", "Bal.wixext"), "-ext", TestData.Get(@"WixToolset.Netfx.wixext.dll"), "-intermediateFolder", intermediateFolder, "-o", bundleFile, @@ -104,11 +87,11 @@ namespace WixToolsetTest.Netfx }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); } } - [Fact] + [TestMethod] public void CanBuildUsingNetFxSearches() { using (var fs = new DisposableFileSystem()) @@ -118,20 +101,12 @@ namespace WixToolsetTest.Netfx var bundleSourceFolder = TestData.Get(@"TestData\UsingNetFxSearches"); var intermediateFolder = Path.Combine(baseFolder, "obj"); - var extensionResult = WixRunner.Execute(warningsAsErrors: true, new[] - { - "extension", "add", - "WixToolset.BootstrapperApplications.wixext", - "extension", "add", - "WixToolset.Util.wixext", - }); - var compileResult = WixRunner.Execute(new[] { "build", Path.Combine(bundleSourceFolder, "BundleLatest.wxs"), - "-ext", "WixToolset.BootstrapperApplications.wixext", - "-ext", "WixToolset.Util.wixext", + "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll").Replace("NetFx.wixext", "Bal.wixext"), + "-ext", TestData.Get(@"WixToolset.Util.wixext.dll").Replace("NetFx.wixext", "Util.wixext"), "-ext", TestData.Get(@"WixToolset.Netfx.wixext.dll"), "-intermediateFolder", intermediateFolder, "-o", bundleFile, @@ -139,11 +114,11 @@ namespace WixToolsetTest.Netfx }); compileResult.AssertSuccess(); - Assert.True(File.Exists(bundleFile)); + Assert.IsTrue(File.Exists(bundleFile)); } } - [Fact] + [TestMethod] public void CanBuildUsingNativeImage() { var folder = TestData.Get(@"TestData\UsingNativeImage"); @@ -162,7 +137,7 @@ namespace WixToolsetTest.Netfx }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingNativeImageX64() { var folder = TestData.Get(@"TestData\UsingNativeImage"); @@ -181,7 +156,7 @@ namespace WixToolsetTest.Netfx }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingNativeImageARM64() { var folder = TestData.Get(@"TestData\UsingNativeImage"); @@ -200,7 +175,7 @@ namespace WixToolsetTest.Netfx }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingDotNetCompatibilityCheck() { var folder = TestData.Get(@"TestData\UsingDotNetCompatibilityCheck"); diff --git a/src/ext/NetFx/test/WixToolsetTest.Netfx/WixToolsetTest.Netfx.csproj b/src/ext/NetFx/test/WixToolsetTest.Netfx/WixToolsetTest.Netfx.csproj index 4e509cce..bdca49e6 100644 --- a/src/ext/NetFx/test/WixToolsetTest.Netfx/WixToolsetTest.Netfx.csproj +++ b/src/ext/NetFx/test/WixToolsetTest.Netfx/WixToolsetTest.Netfx.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/PowerShell/powershell_t.proj b/src/ext/PowerShell/powershell_t.proj new file mode 100644 index 00000000..da54d629 --- /dev/null +++ b/src/ext/PowerShell/powershell_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/PowerShell/ps.cmd b/src/ext/PowerShell/ps.cmd deleted file mode 100644 index 4a8aa61e..00000000 --- a/src/ext/PowerShell/ps.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo PowerShell.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.PowerShell || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.PowerShell.wixext.csproj || exit /b - -@popd -@endlocal diff --git a/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs b/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs index eafda99f..a1dc3282 100644 --- a/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs +++ b/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs @@ -2,14 +2,15 @@ namespace WixToolsetTest.PowerShell { - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.PowerShell; - using Xunit; + [TestClass] public class PowerShellExtensionFixture { - [Fact] + [TestMethod] public void CantBuildUsingTypesFileWithoutSnapIn() { var folder = TestData.Get(@"TestData\TypesFile"); @@ -19,8 +20,8 @@ namespace WixToolsetTest.PowerShell var results = build.BuildAndQuery(args => { wixRunnerResult = WixRunner.Execute(args); }); - Assert.NotNull(wixRunnerResult); - Assert.Equal((int)PSErrors.Ids.NeitherIdSpecified, wixRunnerResult.ExitCode); + Assert.IsNotNull(wixRunnerResult); + Assert.AreEqual((int)PSErrors.Ids.NeitherIdSpecified, wixRunnerResult.ExitCode); } } } diff --git a/src/ext/PowerShell/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj b/src/ext/PowerShell/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj index 347ca1ed..cff13cb7 100644 --- a/src/ext/PowerShell/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj +++ b/src/ext/PowerShell/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/Sql/sql.cmd b/src/ext/Sql/sql.cmd deleted file mode 100644 index 41af0223..00000000 --- a/src/ext/Sql/sql.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo Sql.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.Sql || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.Sql.wixext.csproj || exit /b - -@popd -@endlocal diff --git a/src/ext/Sql/sql_t.proj b/src/ext/Sql/sql_t.proj new file mode 100644 index 00000000..97b2c8fd --- /dev/null +++ b/src/ext/Sql/sql_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/Sql/test/WixToolsetTest.Sql/SqlExtensionFixture.cs b/src/ext/Sql/test/WixToolsetTest.Sql/SqlExtensionFixture.cs index 5576576d..14ca14c3 100644 --- a/src/ext/Sql/test/WixToolsetTest.Sql/SqlExtensionFixture.cs +++ b/src/ext/Sql/test/WixToolsetTest.Sql/SqlExtensionFixture.cs @@ -3,14 +3,15 @@ namespace WixToolsetTest.Sql { using System.Linq; - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.Sql; - using Xunit; + [TestClass] public class SqlExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingSqlStuff() { var folder = TestData.Get(@"TestData\UsingSql"); diff --git a/src/ext/Sql/test/WixToolsetTest.Sql/WixToolsetTest.Sql.csproj b/src/ext/Sql/test/WixToolsetTest.Sql/WixToolsetTest.Sql.csproj index 6c848683..62345258 100644 --- a/src/ext/Sql/test/WixToolsetTest.Sql/WixToolsetTest.Sql.csproj +++ b/src/ext/Sql/test/WixToolsetTest.Sql/WixToolsetTest.Sql.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs index bb20f087..e06feac7 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs @@ -4,15 +4,16 @@ namespace WixToolsetTest.UI { using System.IO; using System.Linq; - using WixInternal.Core.TestPackage; - using WixInternal.TestSupport; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.Core.MSTestPackage; + using WixInternal.MSTestSupport; using WixToolset.Data.WindowsInstaller; using WixToolset.UI; - using Xunit; + [TestClass] public class UIExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingWixUIAdvanced() { var folder = TestData.Get(@"TestData", "WixUI_Advanced"); @@ -20,7 +21,7 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -37,7 +38,7 @@ namespace WixToolsetTest.UI "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); - Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + WixAssert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); WixAssert.CompareLineByLine(new[] { "InstallUISequence:AdvancedWelcomeEulaDlg\tNOT Installed\t1297", @@ -45,7 +46,7 @@ namespace WixToolsetTest.UI }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingWixUIAdvancedX64() { var folder = TestData.Get(@"TestData", "WixUI_Advanced"); @@ -53,7 +54,7 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -70,10 +71,10 @@ namespace WixToolsetTest.UI "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); - Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + WixAssert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingWixUIAdvancedARM64() { var folder = TestData.Get(@"TestData", "WixUI_Advanced"); @@ -81,7 +82,7 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(BuildARM64, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -98,10 +99,10 @@ namespace WixToolsetTest.UI "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); - Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + WixAssert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingWixUIFeatureTree() { var folder = TestData.Get(@"TestData", "WixUI_FeatureTree"); @@ -109,9 +110,9 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); - Assert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t")); - Assert.Empty(results.Where(result => result.StartsWith("Dialog:SetupTypeDlg\t"))); + WixAssert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t")); + WixAssert.Empty(results.Where(result => result.StartsWith("Dialog:SetupTypeDlg\t"))); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -125,14 +126,14 @@ namespace WixToolsetTest.UI { "CustomAction:SetWIXUI_EXITDIALOGOPTIONALTEXT\t51\tWIXUI_EXITDIALOGOPTIONALTEXT\tThank you for installing [ProductName].\t", }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); - Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction"))); + WixAssert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction"))); WixAssert.CompareLineByLine(new[] { "InstallUISequence:WelcomeDlg\tNOT Installed OR PATCH\t1297", }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } - [Fact] + [TestMethod] public void CanBuildWithWixUIInstallDirWithCustomizedEula() { var folder = TestData.Get(@"TestData", "WixUI_InstallDir"); @@ -140,8 +141,8 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(BuildEula, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); - Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -171,7 +172,7 @@ namespace WixToolsetTest.UI }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingWixUIMinimal() { var folder = TestData.Get(@"TestData", "WixUI_Minimal"); @@ -179,7 +180,7 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:WelcomeEulaDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:WelcomeEulaDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -189,8 +190,8 @@ namespace WixToolsetTest.UI "Binary:WixUI_Ico_Exclam\t[Binary data]", "Binary:WixUI_Ico_Info\t[Binary data]", }, results.Where(r => r.StartsWith("Binary:")).ToArray()); - Assert.Empty(results.Where(r => r.StartsWith("CustomAction:"))); - Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction"))); + WixAssert.Empty(results.Where(r => r.StartsWith("CustomAction:"))); + WixAssert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction"))); WixAssert.CompareLineByLine(new[] { "InstallUISequence:WelcomeDlg\tInstalled AND PATCH\t1296", @@ -198,7 +199,7 @@ namespace WixToolsetTest.UI }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingWixUIMinimalInKazakh() { var folder = TestData.Get(@"TestData", "WixUI_Minimal"); @@ -207,10 +208,10 @@ namespace WixToolsetTest.UI var results = build.BuildAndQuery(BuildInKazakh, "Dialog"); var welcomeDlg = results.Where(r => r.StartsWith("Dialog:WelcomeDlg\t")).Select(r => r.Split('\t')).Single(); - Assert.Equal("[ProductName] бағдарламасын орнату", welcomeDlg[6]); + Assert.AreEqual("[ProductName] бағдарламасын орнату", welcomeDlg[6]); } - [Fact] + [TestMethod] public void CanBuildUsingWixUIMinimalAndReadPdb() { var folder = TestData.Get(@"TestData", "WixUI_Minimal"); @@ -236,7 +237,7 @@ namespace WixToolsetTest.UI } } - [Fact] + [TestMethod] public void CanBuildUsingWixUIMondo() { var folder = TestData.Get(@"TestData", "WixUI_Mondo"); @@ -244,9 +245,9 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); - Assert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t")); - Assert.Single(results, result => result.StartsWith("Dialog:SetupTypeDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:SetupTypeDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -271,7 +272,7 @@ namespace WixToolsetTest.UI }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingWixUIMondoLocalized() { var folder = TestData.Get(@"TestData", "WixUI_Mondo"); @@ -285,7 +286,7 @@ namespace WixToolsetTest.UI }, results.Where(s => s.StartsWith("Control:ErrorDlg\tY")).Select(s => s.Split('\t')[9]).ToArray()); } - [Fact] + [TestMethod] public void CanBuildWithInstallDirAndRemovedDialog() { var folder = TestData.Get(@"TestData", "InstallDir_NoLicense"); @@ -293,7 +294,7 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -318,7 +319,7 @@ namespace WixToolsetTest.UI "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\t1\t2", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); - Assert.Empty(results.Where(result => result.Contains("LicenseAgreementDlg")).ToArray()); + WixAssert.Empty(results.Where(result => result.Contains("LicenseAgreementDlg")).ToArray()); WixAssert.CompareLineByLine(new[] { @@ -326,7 +327,7 @@ namespace WixToolsetTest.UI }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } - [Fact] + [TestMethod] public void CanBuildWithInstallDirAndAddedDialog() { var folder = TestData.Get(@"TestData", "InstallDir_SpecialDlg"); @@ -334,7 +335,7 @@ namespace WixToolsetTest.UI var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); var results = build.BuildAndQuery(BuildX64, "Binary", "Control", "Dialog", "CustomAction", "Property", "ControlEvent", "InstallUISequence"); - Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); + WixAssert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -344,23 +345,23 @@ namespace WixToolsetTest.UI "Binary:WixUI_Ico_Exclam\t[Binary data]", "Binary:WixUI_Ico_Info\t[Binary data]", }, results.Where(r => r.StartsWith("Binary:")).ToArray()); - Assert.Empty(results.Where(r => r.StartsWith("CustomAction:")).ToArray()); + WixAssert.Empty(results.Where(r => r.StartsWith("CustomAction:")).ToArray()); WixAssert.CompareLineByLine(new[] { "Property:WIXUI_INSTALLDIR\tINSTALLFOLDER", }, results.Where(r => r.StartsWith("Property:WIXUI")).ToArray()); - Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); + WixAssert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); WixAssert.CompareLineByLine(new[] { "InstallUISequence:WelcomeDlg\tNOT Installed OR PATCH\t1297", }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); - Assert.Equal(10, results.Where(result => result.StartsWith("Control:") && result.Contains("SpecialDlg")).Count()); - Assert.Equal(5, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("SpecialDlg")).Count()); - Assert.Single(results.Where(result => result.StartsWith("Dialog:") && result.Contains("SpecialDlg"))); + Assert.AreEqual(10, results.Where(result => result.StartsWith("Control:") && result.Contains("SpecialDlg")).Count()); + Assert.AreEqual(5, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("SpecialDlg")).Count()); + WixAssert.Single(results.Where(result => result.StartsWith("Dialog:") && result.Contains("SpecialDlg"))); } - [Fact] + [TestMethod] public void CannotBuildWithV3LikeUIRef() { var folder = TestData.Get(@"TestData", "InvalidUIRef"); @@ -381,7 +382,7 @@ namespace WixToolsetTest.UI var results = WixRunner.Execute(args); var message = results.Messages.Single(); - Assert.Equal("The identifier 'WixUI:WixUI_Mondo' is inaccessible due to its protection level.", message.ToString()); + Assert.AreEqual("The identifier 'WixUI:WixUI_Mondo' is inaccessible due to its protection level.", message.ToString()); } } diff --git a/src/ext/UI/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj b/src/ext/UI/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj index 675f14f8..132920c5 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj +++ b/src/ext/UI/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/UI/ui.cmd b/src/ext/UI/ui.cmd deleted file mode 100644 index a990db91..00000000 --- a/src/ext/UI/ui.cmd +++ /dev/null @@ -1,42 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -@set _L=%~dp0..\..\..\build\logs - -:parse_args -@if /i "%1"=="release" set _C=Release -@if /i "%1"=="inc" set _INC=1 -@if /i "%1"=="clean" set _CLEAN=1 -@if not "%1"=="" shift & goto parse_args - -@set _B=%~dp0..\..\..\build\UI.wixext\%_C% - -:: Clean - -@if "%_INC%"=="" call :clean -@if NOT "%_CLEAN%"=="" goto :end - -@echo UI.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror -bl:%_L%\ext_ui_build.binlog || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.UI || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.UI.wixext.csproj || exit /b - -@goto :end - -:clean -@rd /s/q "..\..\..\build\UI.wixext" 2> nul -@del "..\..\..\build\artifacts\WixToolset.UI.wixext.*.nupkg" 2> nul -@del "%_L%\ext_ui_build.binlog" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.ui.wixext" 2> nul -@exit /b - -:end -@popd -@endlocal diff --git a/src/ext/UI/ui_t.proj b/src/ext/UI/ui_t.proj new file mode 100644 index 00000000..0a989b6f --- /dev/null +++ b/src/ext/UI/ui_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs index 13c39091..03d87e4e 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs @@ -2,19 +2,20 @@ namespace WixToolsetTest.Util { + using System; using System.IO; using System.Linq; using System.Xml; - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; - using WixToolset.Util; - using Xunit; using System.Xml.Linq; - using System; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; + using WixToolset.Util; + [TestClass] public class UtilExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingFileShare() { var folder = TestData.Get(@"TestData\UsingFileShare"); @@ -35,7 +36,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildUsingFileShareX64() { var folder = TestData.Get(@"TestData\UsingFileShare"); @@ -56,7 +57,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanRoundtripFileShare() { var folder = TestData.Get(@"TestData", "UsingFileShare"); @@ -79,7 +80,7 @@ namespace WixToolsetTest.Util }, utilElementNames); } - [Fact] + [TestMethod] public void CanBuildCloseApplication() { var folder = TestData.Get(@"TestData\CloseApplication"); @@ -96,7 +97,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildInternetShortcutInProduct() { var folder = TestData.Get(@"TestData\InternetShortcut"); @@ -116,7 +117,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildInternetShortcutInMergeModule() { var folder = TestData.Get(@"TestData\InternetShortcutModule"); @@ -136,7 +137,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildWithPermissionEx() { var folder = TestData.Get(@"TestData\PermissionEx"); @@ -153,7 +154,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildRemoveRegistryKeyExInMergeModule() { var folder = TestData.Get(@"TestData", "RemoveRegistryKeyEx"); @@ -168,7 +169,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildRemoveFolderExInMergeModule() { var folder = TestData.Get(@"TestData\RemoveFolderEx"); @@ -183,7 +184,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildRemoveFolderExInPackage() { var folder = TestData.Get(@"TestData\RemoveFolderExPackage"); @@ -198,7 +199,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildServiceConfig() { var folder = TestData.Get(@"TestData", "ServiceConfig"); @@ -215,7 +216,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildWithEventManifest() { var folder = TestData.Get(@"TestData\EventManifest"); @@ -240,7 +241,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildWithQueries() { var folder = TestData.Get(@"TestData\Queries"); @@ -259,7 +260,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildAndDecompiileQueries() { var folder = TestData.Get(@"TestData\Queries"); @@ -285,7 +286,7 @@ namespace WixToolsetTest.Util }, utilElementNames); } - [Fact] + [TestMethod] public void CanBuildWithXmlConfig() { var folder = TestData.Get(@"TestData", "XmlConfig"); @@ -301,7 +302,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanRoundtripXmlConfig() { var folder = TestData.Get(@"TestData", "XmlConfig"); @@ -324,7 +325,7 @@ namespace WixToolsetTest.Util }, utilElementNames); } - [Fact] + [TestMethod] public void CanBuildModuleWithXmlConfig() { var folder = TestData.Get(@"TestData", "XmlConfigModule"); @@ -338,7 +339,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanBuildBundleWithSearches() { var folder = TestData.Get(@"TestData\BundleWithSearches"); @@ -366,15 +367,15 @@ namespace WixToolsetTest.Util result.AssertSuccess(); - Assert.True(File.Exists(bundlePath)); - Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); + Assert.IsTrue(File.Exists(bundlePath)); + Assert.IsTrue(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); var bootstrapperExtensionDatas = extractResult.SelectBootstrapperExtensionDataNodes("/be:BootstrapperExtensionData/be:BootstrapperExtension[@Id='Wix4UtilBootstrapperExtension_X86']"); - Assert.Equal(1, bootstrapperExtensionDatas.Count); - Assert.Equal("" + + Assert.AreEqual(1, bootstrapperExtensionDatas.Count); + Assert.AreEqual("" + "" + "", bootstrapperExtensionDatas[0].GetTestXml()); @@ -394,7 +395,7 @@ namespace WixToolsetTest.Util } } - [Fact] + [TestMethod] public void CanCreateUserGroupWithComment() { var folder = TestData.Get(@"TestData\CreateGroup"); @@ -550,7 +551,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CanCreateUserAccountWithComment() { var folder = TestData.Get(@"TestData\CreateUser"); @@ -626,7 +627,7 @@ namespace WixToolsetTest.Util }, results.OrderBy(s => s).ToArray()); } - [Fact] + [TestMethod] public void CannotBuildBundleWithSearchesUsingBuiltinVariableNames() { var folder = TestData.Get("TestData", "BundleWithSearches"); diff --git a/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj b/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj index 16d0e138..4036c3ab 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj +++ b/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/Util/util.cmd b/src/ext/Util/util.cmd deleted file mode 100644 index 3c66e7d8..00000000 --- a/src/ext/Util/util.cmd +++ /dev/null @@ -1,45 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -@set _L=%~dp0..\..\..\build\logs - -:parse_args -@if /i "%1"=="release" set _C=Release -@if /i "%1"=="inc" set _INC=1 -@if /i "%1"=="clean" set _CLEAN=1 -@if not "%1"=="" shift & goto parse_args - -@set _B=%~dp0..\..\..\build\Util.wixext\%_C% - -:: Clean - -@if "%_INC%"=="" call :clean -@if NOT "%_CLEAN%"=="" goto :end - -@echo Building ext\Util %_C% using %_N% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror -bl:%_L%\ext_util_build.binlog || exit /b - -:: Test -dotnet test ^ - %_B%\net6.0\WixToolsetTest.Util.dll ^ - --nologo -l "trx;LogFileName=%_L%\TestResults\util.wixext.trx" || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.Util.wixext.csproj || exit /b - -@goto :end - -:clean -@rd /s/q "..\..\build\Util.wixext" 2> nul -@del "..\..\build\artifacts\WixToolset.Util.wixext.*.nupkg" 2> nul -@del "%_L%\ext_util_build.binlog" 2> nul -@del "%_L%\TestResults\util.wixext.trx" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.util.wixext" 2> nul -@exit /b - -:end -@popd -@endlocal diff --git a/src/ext/Util/util_t.proj b/src/ext/Util/util_t.proj new file mode 100644 index 00000000..e1da6adf --- /dev/null +++ b/src/ext/Util/util_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs index f3e81e2d..992ac953 100644 --- a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs +++ b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs @@ -2,15 +2,16 @@ namespace WixToolsetTest.VisualStudio { - using WixInternal.TestSupport; - using WixInternal.Core.TestPackage; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using WixInternal.MSTestSupport; + using WixInternal.Core.MSTestPackage; using WixToolset.VisualStudio; - using Xunit; using System.Linq; + [TestClass] public class VisualStudioExtensionFixture { - [Fact] + [TestMethod] public void CanBuildUsingVsixPackage() { var folder = TestData.Get(@"TestData\UsingVsixPackage"); @@ -36,7 +37,7 @@ namespace WixToolsetTest.VisualStudio }, results); } - [Fact] + [TestMethod] public void CanBuildUsingVsixPackageOnArm64() { var folder = TestData.Get(@"TestData\UsingVsixPackage"); diff --git a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/WixToolsetTest.VisualStudio.csproj b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/WixToolsetTest.VisualStudio.csproj index 2b0a7c1c..9cfb6867 100644 --- a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/WixToolsetTest.VisualStudio.csproj +++ b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/WixToolsetTest.VisualStudio.csproj @@ -1,10 +1,10 @@ - + net6.0 - true + true @@ -16,6 +16,7 @@ - + + diff --git a/src/ext/VisualStudio/visualstudio_t.proj b/src/ext/VisualStudio/visualstudio_t.proj new file mode 100644 index 00000000..52de8019 --- /dev/null +++ b/src/ext/VisualStudio/visualstudio_t.proj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/ext/VisualStudio/vs.cmd b/src/ext/VisualStudio/vs.cmd deleted file mode 100644 index f0873f1d..00000000 --- a/src/ext/VisualStudio/vs.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@setlocal -@pushd %~dp0 - -@set _C=Debug -:parse_args -@if /i "%1"=="release" set _C=Release -@if not "%1"=="" shift & goto parse_args - -@echo VisualStudio.wixext build %_C% - -:: Build -msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror || exit /b - -:: Test -dotnet test -c %_C% --no-build test\WixToolsetTest.VisualStudio || exit /b - -:: Pack -msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.VisualStudio.wixext.csproj || exit /b - -@popd -@endlocal diff --git a/src/ext/ext.cmd b/src/ext/ext.cmd index 8575b81e..86aac47b 100644 --- a/src/ext/ext.cmd +++ b/src/ext/ext.cmd @@ -2,58 +2,15 @@ @pushd %~dp0 @set _C=Debug +@set _L=%~dp0..\..\build\logs +@set _SuppressWixClean=false + :parse_args @if /i "%1"=="release" set _C=Release +@if /i "%1"=="inc" set _SuppressWixClean=true @if not "%1"=="" shift & goto parse_args -@echo ext build %_C% - -:: These extensions must be built in this order. - -:: Util -call Util\util.cmd %_C% || exit /b - -:: Bal -call Bal\bal.cmd %_C% || exit /b - -:: NetFx -call NetFx\netfx.cmd %_C% || exit /b - - -:: The rest of the extensions are in alphabetical order. - -:: ComPlus -call ComPlus\complus.cmd %_C% || exit /b - -:: Dependency -call Dependency\dependency.cmd %_C% || exit /b - -:: DirectX -call DirectX\directx.cmd %_C% || exit /b - -:: Firewall -call Firewall\firewall.cmd %_C% || exit /b - -:: Http -call Http\http.cmd %_C% || exit /b - -:: Iis -call Iis\iis.cmd %_C% || exit /b - -:: Msmq -call Msmq\msmq.cmd %_C% || exit /b - -:: PowerShell -call PowerShell\ps.cmd %_C% || exit /b - -:: Sql -call Sql\sql.cmd %_C% || exit /b - -:: UI -call UI\ui.cmd %_C% || exit /b - -:: VisualStudio -call VisualStudio\vs.cmd %_C% || exit /b +msbuild ext_t.proj -p:Configuration=%_C% -p:SuppressWixClean=%_SuppressWixClean% -m -tl -nologo -warnaserror -bl:%_L%\ext_build.binlog || exit /b @popd @endlocal diff --git a/src/ext/ext_t.proj b/src/ext/ext_t.proj new file mode 100644 index 00000000..e3301172 --- /dev/null +++ b/src/ext/ext_t.proj @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3-55-g6feb