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/PowerShell/powershell_t.proj | 17 +++++++++++++++++ src/ext/PowerShell/ps.cmd | 21 --------------------- .../PowerShellExtensionFixture.cs | 13 +++++++------ .../WixToolsetTest.Powershell.csproj | 7 ++++--- 4 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 src/ext/PowerShell/powershell_t.proj delete mode 100644 src/ext/PowerShell/ps.cmd (limited to 'src/ext/PowerShell') 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 @@ - + + -- cgit v1.2.3-55-g6feb