Try to make it easier to add new kinds of tests.
Sean Hall committed
Jan 1, 2021 at 21:35 UTC
47724ab546a84e77b4699bc28aa4e4ad7901253f
50 files changed
+19
-18
src/TestData/BasicFunctionalityTests/BundleA/BundleA.wixproj
renamed
src/TestData/BasicFunctionalityTests/BundleA/BundleA.wxi
renamed
src/TestData/BasicFunctionalityTests/BundleA/BundleA.wxs
renamed
src/TestData/BasicFunctionalityTests/PackageA/PackageA.wixproj
renamed
src/TestData/MsiTransactionTests/BundleAv1/BundleA.wxi
renamed
src/TestData/MsiTransactionTests/BundleAv1/BundleAv1.wixproj
renamed
src/TestData/MsiTransactionTests/BundleAv1/BundleAv1.wxs
renamed
src/TestData/MsiTransactionTests/BundleAv2/BundleAv2.wixproj
renamed
src/TestData/MsiTransactionTests/BundleAv2/BundleAv2.wxs
renamed
src/TestData/MsiTransactionTests/BundleBv1/BundleB.wxi
renamed
src/TestData/MsiTransactionTests/BundleBv1/BundleBv1.wixproj
renamed
src/TestData/MsiTransactionTests/BundleBv1/BundleBv1.wxs
renamed
src/TestData/MsiTransactionTests/BundleBv2/BundleBv2.wixproj
renamed
src/TestData/MsiTransactionTests/BundleBv2/BundleBv2.wxs
renamed
src/TestData/MsiTransactionTests/PackageA/PackageA.wixproj
renamed
src/TestData/MsiTransactionTests/PackageBv1/PackageB.props
renamed
src/TestData/MsiTransactionTests/PackageBv1/PackageBv1.wixproj
renamed
src/TestData/MsiTransactionTests/PackageBv2/PackageBv2.wixproj
renamed
src/TestData/MsiTransactionTests/PackageCv1/PackageC.props
renamed
src/TestData/MsiTransactionTests/PackageCv1/PackageCv1.wixproj
renamed
src/TestData/MsiTransactionTests/PackageCv2/PackageCv2.wixproj
renamed
src/TestData/MsiTransactionTests/PackageD/PackageD.wixproj
renamed
src/TestData/MsiTransactionTests/PackageF/PackageF.wixproj
renamed
src/TestData/PrereqBaTests/BundleA/BundleA.wixproj
renamed
+1
-1
@@ -4,7 +4,7 @@
4
<OutputType>Bundle</OutputType>
5
</PropertyGroup>
6
<ItemGroup>
7
- <BindInputPaths Include="$(OutputPath)..\net5.0-windows\win-x86" BindName="dnc5x86" />
7
+ <BindInputPaths Include="$(BaseOutputPath)$(Configuration)\net5.0-windows\win-x86" BindName="dnc5x86" />
8
</ItemGroup>
9
<ItemGroup>
10
<ProjectReference Include="..\PackageA\PackageA.wixproj" />
src/TestData/PrereqBaTests/BundleA/BundleA.wxi
renamed
src/TestData/PrereqBaTests/BundleA/BundleA.wxs
renamed
src/TestData/PrereqBaTests/BundleA/bad.runtimeconfig.json
renamed
src/TestData/PrereqBaTests/BundleB/BundleB.wixproj
renamed
+1
-1
@@ -4,7 +4,7 @@
4
<OutputType>Bundle</OutputType>
5
</PropertyGroup>
6
<ItemGroup>
7
- <BindInputPaths Include="$(OutputPath)..\net35\win-x86" BindName="net2x86" />
7
+ <BindInputPaths Include="$(BaseOutputPath)$(Configuration)\net35\win-x86" BindName="net2x86" />
8
</ItemGroup>
9
<ItemGroup>
10
<ProjectReference Include="..\PackageB\PackageB.wixproj" />
src/TestData/PrereqBaTests/BundleB/BundleB.wxi
renamed
src/TestData/PrereqBaTests/BundleB/BundleB.wxs
renamed
src/TestData/PrereqBaTests/BundleB/bad.config
renamed
src/TestData/PrereqBaTests/PackageA/PackageA.wixproj
renamed
src/TestData/PrereqBaTests/PackageB/PackageB.wixproj
renamed
src/TestData/PrereqBaTests/PackageF/PackageF.wixproj
renamed
src/TestData/RollbackBoundaryTests/BundleA/BundleA.wixproj
renamed
src/TestData/RollbackBoundaryTests/BundleA/BundleA.wxi
renamed
src/TestData/RollbackBoundaryTests/BundleA/BundleA.wxs
renamed
src/TestData/RollbackBoundaryTests/PackageA/PackageA.wixproj
renamed
src/TestData/RollbackBoundaryTests/PackageB/PackageB.wixproj
renamed
src/TestData/RollbackBoundaryTests/PackageC/PackageC.wixproj
renamed
src/TestData/RollbackBoundaryTests/PackageF/PackageF.wixproj
renamed
src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj
+2
-2
@@ -6,8 +6,8 @@
6
<Cultures>en-us</Cultures>
7
</PropertyGroup>
8
<ItemGroup>
9
- <BindInputPaths Include="$(OutputPath)..\net35\win-x86" BindName="net2x86" />
10
- <BindInputPaths Include="$(OutputPath)..\net5.0-windows\win-x86" BindName="dnc5x86" />
9
+ <BindInputPaths Include="$(BaseOutputPath)$(Configuration)\net35\win-x86" BindName="net2x86" />
10
+ <BindInputPaths Include="$(BaseOutputPath)$(Configuration)\net5.0-windows\win-x86" BindName="dnc5x86" />
11
</ItemGroup>
12
<ItemGroup>
13
<ProjectReference Include="..\..\..\Utilities\TestBA\TestBA.csproj" />
src/Wix.Build.props
+1
-1
@@ -3,6 +3,6 @@
3
<PropertyGroup>
4
<TestGroupName Condition=" '$(TestGroupName)'=='' ">$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))))</TestGroupName>
5
<BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(TestGroupName)\$(ProjectName)\</BaseIntermediateOutputPath>
6
- <OutputPath>$(OutputPath)$(TestGroupName)\</OutputPath>
6
+ <OutputPath>$(OutputPath)netcoreapp3.1\TestData\$(TestGroupName)\</OutputPath>
7
</PropertyGroup>
8
</Project>
src/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs
+1
-1
@@ -9,7 +9,7 @@ namespace WixToolsetTest.BurnE2E
9
10
public class BasicFunctionalityTests : BurnE2ETests
11
{
12
- public BasicFunctionalityTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper, "BasicFunctionality") { }
12
+ public BasicFunctionalityTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
13
14
[Fact]
15
public void CanInstallAndUninstallSimpleBundle()
src/WixToolsetTest.BurnE2E/BurnE2ETests.cs
+1
-1
@@ -10,7 +10,7 @@ namespace WixToolsetTest.BurnE2E
10
[Collection("BurnE2E")]
11
public abstract class BurnE2ETests : WixTestBase, IDisposable
12
{
13
- protected BurnE2ETests(ITestOutputHelper testOutputHelper, string testGroupName) : base(testOutputHelper, testGroupName) { }
13
+ protected BurnE2ETests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
15
private Queue<IDisposable> Installers { get; } = new Queue<IDisposable>();
16
src/WixToolsetTest.BurnE2E/MsiTransactionTests.cs
+1
-1
@@ -9,7 +9,7 @@ namespace WixToolsetTest.BurnE2E
9
10
public class MsiTransactionTests : BurnE2ETests
11
{
12
- public MsiTransactionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper, "MsiTransaction") { }
12
+ public MsiTransactionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
13
14
[Fact]
15
public void CanUpgradeBundleWithMsiTransaction()
src/WixToolsetTest.BurnE2E/PrereqBaTests.cs
+1
-1
@@ -9,7 +9,7 @@ namespace WixToolsetTest.BurnE2E
9
10
public class PrereqBaTests : BurnE2ETests
11
{
12
- public PrereqBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper, "PrereqBa") { }
12
+ public PrereqBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
13
14
/// <summary>
15
/// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist,
src/WixToolsetTest.BurnE2E/RollbackBoundaryTests.cs
+1
-1
@@ -9,7 +9,7 @@ namespace WixToolsetTest.BurnE2E
9
10
public class RollbackBoundaryTests : BurnE2ETests
11
{
12
- public RollbackBoundaryTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper, "RollbackBoundary") { }
12
+ public RollbackBoundaryTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
13
14
/// <summary>
15
/// Installs 1 bundle:
src/WixToolsetTest.BurnE2E/WixTestBase.cs
+2
-4
@@ -2,15 +2,13 @@
2
3
namespace WixToolsetTest.BurnE2E
4
{
5
- using System;
6
- using System.IO;
5
using Xunit.Abstractions;
6
7
public abstract class WixTestBase
8
{
11
- protected WixTestBase(ITestOutputHelper testOutputHelper, string testGroupName)
9
+ protected WixTestBase(ITestOutputHelper testOutputHelper)
10
{
13
- this.TestContext = new WixTestContext(testOutputHelper, testGroupName);
11
+ this.TestContext = new WixTestContext(testOutputHelper);
12
}
13
14
/// <summary>
src/WixToolsetTest.BurnE2E/WixTestContext.cs
+7
-4
@@ -4,6 +4,7 @@ namespace WixToolsetTest.BurnE2E
4
{
5
using System;
6
using System.IO;
7
+ using System.Linq;
8
using System.Reflection;
9
using Microsoft.Win32;
10
using WixBuildTools.TestSupport;
@@ -11,15 +12,17 @@ namespace WixToolsetTest.BurnE2E
12
13
public class WixTestContext
14
{
14
- static readonly string RootDataPath = Path.GetFullPath(TestData.Get(".."));
15
+ static readonly string RootDataPath = Path.GetFullPath(TestData.Get("TestData"));
16
16
- public WixTestContext(ITestOutputHelper testOutputHelper, string testGroupName)
17
+ public WixTestContext(ITestOutputHelper testOutputHelper)
18
{
19
var test = GetTest(testOutputHelper);
20
+ var splitClassName = test.TestCase.TestMethod.TestClass.Class.Name.Split('.');
21
20
- this.TestDataFolder = Path.Combine(RootDataPath, testGroupName);
21
- this.TestGroupName = testGroupName;
22
+ this.TestGroupName = splitClassName.Last();
23
this.TestName = test.TestCase.TestMethod.Method.Name;
24
+
25
+ this.TestDataFolder = Path.Combine(RootDataPath, this.TestGroupName);
26
}
27
28
public string TestDataFolder { get; }