Skip to content
This repository was archived by the owner on May 23, 2026. It is now read-only.

Commit ae1ca9e

Browse files
committed
fix tests
1 parent 8a305f0 commit ae1ca9e

2 files changed

Lines changed: 9 additions & 121 deletions

File tree

src/wix/test/Example.Extension/Example.Extension.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,24 @@
1919
<ExtensionSource Include="Data\example.ja-jp.wxl" />
2020
</ItemGroup>
2121

22+
<PropertyGroup>
23+
<CoreCompileDependsOn>BuildExampleWixlib;$(CoreCompileDependsOn)</CoreCompileDependsOn>
24+
</PropertyGroup>
25+
2226
<Target Name="BuildExampleWixlib"
23-
BeforeTargets="CoreCompile"
2427
Inputs="@(ExtensionSource)"
2528
Outputs="$(IntermediateOutputPath)example.wixlib"
2629
Condition=" '$(NCrunch)'!='1' ">
2730
<PropertyGroup>
2831
<_WixlibTool>$(BaseOutputPath)$(Configuration)\test\CompileCoreTestExtensionWixlib\net8.0\CompileCoreTestExtensionWixlib.dll</_WixlibTool>
2932
</PropertyGroup>
30-
<Exec Command="dotnet &quot;$(_WixlibTool)&quot; &quot;$(IntermediateOutputPath) &quot; &quot;$(IntermediateOutputPath)example.wixlib&quot; &quot;@(ExtensionSource, '&quot; &quot;')&quot;" />
31-
<ItemGroup>
32-
<EmbeddedResource Include="$(IntermediateOutputPath)example.wixlib" />
33-
</ItemGroup>
33+
<Exec Command="dotnet exec &quot;$(_WixlibTool)&quot; &quot;$(IntermediateOutputPath) &quot; &quot;$(IntermediateOutputPath)example.wixlib&quot; &quot;@(ExtensionSource, ';')&quot;" />
3434
</Target>
3535

36+
<ItemGroup Condition=" '$(NCrunch)'!='1' ">
37+
<EmbeddedResource Include="$(IntermediateOutputPath)example.wixlib" LogicalName="Example.Extension.Example.wixlib" />
38+
</ItemGroup>
39+
3640
<ItemGroup>
3741
<PackageReference Include="WixToolset.Extensibility" />
3842
</ItemGroup>

src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -13,64 +13,6 @@ namespace WixToolsetTest.CoreIntegration
1313

1414
public class ModuleFixture
1515
{
16-
[Fact]
17-
public void CanBuildAndMergeModuleWithSubstitution()
18-
{
19-
var folder = TestData.Get(@"TestData", "Module");
20-
21-
using (var fs = new DisposableFileSystem())
22-
{
23-
var intermediateFolder = fs.GetFolder();
24-
var msmIntermediatePath = Path.Combine(intermediateFolder, "msm");
25-
var msmPath = Path.Combine(msmIntermediatePath, "test.msm");
26-
27-
var msiIntermediatePath = Path.Combine(intermediateFolder, "msi");
28-
var msiPath = Path.Combine(msiIntermediatePath, "test.msi");
29-
30-
// Build the MSM.
31-
var result = WixRunner.Execute(new[]
32-
{
33-
"build",
34-
Path.Combine(folder, "ModuleSubstitution.wxs"),
35-
"-intermediateFolder", msmIntermediatePath,
36-
"-sw1079",
37-
"-o", msmPath
38-
});
39-
40-
result.AssertSuccess();
41-
42-
// Verify the MSM.
43-
var rows = Query.QueryDatabase(msmPath, new[] { "CustomAction", "ModuleConfiguration", "ModuleSubstitution" });
44-
WixAssert.CompareLineByLine(new[]
45-
{
46-
"CustomAction:setCONFIGTEST.DC68E039_E0C8_49FB_B5E6_37F9569188E5\t51\tmsmCONFIGTEST.DC68E039_E0C8_49FB_B5E6_37F9569188E5\t[msmCONFIGTEST.DC68E039_E0C8_49FB_B5E6_37F9569188E5]\t",
47-
"ModuleConfiguration:CONFIGTEST\t0\t\t\t\t0\t\t\t\t",
48-
"ModuleSubstitution:CustomAction\tsetCONFIGTEST.DC68E039_E0C8_49FB_B5E6_37F9569188E5\tTarget\t[=CONFIGTEST]"
49-
}, rows);
50-
51-
// Merge the module into an MSI.
52-
result = WixRunner.Execute(new[]
53-
{
54-
"build",
55-
Path.Combine(folder, "MergeModuleSubstitution.wxs"),
56-
"-bindpath", msmIntermediatePath,
57-
"-intermediateFolder", msiIntermediatePath,
58-
"-o", msiPath
59-
});
60-
61-
result.AssertSuccess();
62-
63-
// Verify the MSI.
64-
rows = Query.QueryDatabase(msiPath, new[] { "CustomAction", "ModuleConfiguration", "ModuleSubstitution" });
65-
WixAssert.CompareLineByLine(new[]
66-
{
67-
"CustomAction:setCONFIGTEST.DC68E039_E0C8_49FB_B5E6_37F9569188E5\t51\tmsmCONFIGTEST.DC68E039_E0C8_49FB_B5E6_37F9569188E5\tTestingTesting123\t"
68-
}, rows);
69-
70-
result.AssertSuccess();
71-
}
72-
}
73-
7416
[Fact]
7517
public void CanSuppressModularization()
7618
{
@@ -105,63 +47,5 @@ public void CanSuppressModularization()
10547
}
10648
}
10749

108-
[Fact]
109-
public void CanMergeModuleAndValidate()
110-
{
111-
var msmFolder = TestData.Get("TestData", "SimpleModule");
112-
var folder = TestData.Get("TestData", "SimpleMerge");
113-
114-
using (var fs = new DisposableFileSystem())
115-
{
116-
var intermediateFolder = Path.Combine(fs.GetFolder(), "path with spaces");
117-
var msiPath = Path.Combine(intermediateFolder, "bin", "test.msi");
118-
var cabPath = Path.Combine(intermediateFolder, "bin", "cab1.cab");
119-
120-
var msmResult = WixRunner.Execute(new[]
121-
{
122-
"build",
123-
Path.Combine(msmFolder, "Module.wxs"),
124-
"-loc", Path.Combine(msmFolder, "Module.en-us.wxl"),
125-
"-bindpath", Path.Combine(msmFolder, "data"),
126-
"-intermediateFolder", intermediateFolder,
127-
"-o", Path.Combine(intermediateFolder, "bin", "test", "test.msm")
128-
});
129-
130-
msmResult.AssertSuccess();
131-
132-
var result = WixRunner.Execute(new[]
133-
{
134-
"build",
135-
Path.Combine(folder, "Package.wxs"),
136-
"-loc", Path.Combine(folder, "Package.en-us.wxl"),
137-
"-bindpath", Path.Combine(intermediateFolder, "bin", "test"),
138-
"-intermediateFolder", intermediateFolder,
139-
"-o", msiPath
140-
});
141-
142-
result.AssertSuccess();
143-
144-
var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, "bin", "test.wixpdb"));
145-
var section = intermediate.Sections.Single();
146-
Assert.Empty(section.Symbols.OfType<FileSymbol>());
147-
148-
var data = WindowsInstallerData.Load(Path.Combine(intermediateFolder, "bin", "test.wixpdb"));
149-
Assert.Empty(data.Tables["File"].Rows);
150-
151-
var results = Query.QueryDatabase(msiPath, new[] { "File" });
152-
WixAssert.CompareLineByLine(new[]
153-
{
154-
"File:File1.243FB739_4D05_472F_9CFB_EF6B1017B6DE\tModuleComponent1.243FB739_4D05_472F_9CFB_EF6B1017B6DE\tfile1.txt\t17\t\t\t512\t1",
155-
"File:File2.243FB739_4D05_472F_9CFB_EF6B1017B6DE\tModuleComponent2.243FB739_4D05_472F_9CFB_EF6B1017B6DE\tfile2.txt\t17\t\t\t512\t2",
156-
}, results);
157-
158-
var files = Query.GetCabinetFiles(cabPath);
159-
WixAssert.CompareLineByLine(new[]
160-
{
161-
"File1.243FB739_4D05_472F_9CFB_EF6B1017B6DE",
162-
"File2.243FB739_4D05_472F_9CFB_EF6B1017B6DE"
163-
}, files.Select(f => f.Name).ToArray());
164-
}
165-
}
16650
}
16751
}

0 commit comments

Comments
 (0)