diff options
Diffstat (limited to 'src')
4 files changed, 82 insertions, 2 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 6fea6e36..e2a672b7 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
| @@ -681,6 +681,38 @@ namespace WixToolsetTest.CoreIntegration | |||
| 681 | } | 681 | } |
| 682 | 682 | ||
| 683 | [Fact] | 683 | [Fact] |
| 684 | public void PopulatesTypeLibTableWhenLanguageIsZero() | ||
| 685 | { | ||
| 686 | var folder = TestData.Get(@"TestData"); | ||
| 687 | |||
| 688 | using (var fs = new DisposableFileSystem()) | ||
| 689 | { | ||
| 690 | var baseFolder = fs.GetFolder(); | ||
| 691 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 692 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 693 | |||
| 694 | var result = WixRunner.Execute(new[] | ||
| 695 | { | ||
| 696 | "build", | ||
| 697 | Path.Combine(folder, "TypeLib", "Language0.wxs"), | ||
| 698 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 699 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 700 | "-intermediateFolder", intermediateFolder, | ||
| 701 | "-o", msiPath | ||
| 702 | }); | ||
| 703 | |||
| 704 | result.AssertSuccess(); | ||
| 705 | |||
| 706 | Assert.True(File.Exists(msiPath)); | ||
| 707 | var results = Query.QueryDatabase(msiPath, new[] { "TypeLib" }); | ||
| 708 | Assert.Equal(new[] | ||
| 709 | { | ||
| 710 | "TypeLib:{765BE8EE-BD7F-491E-90D2-C5A972462B50}\t0\tTypeLibComp\t\t\t\tProductFeature\t", | ||
| 711 | }, results); | ||
| 712 | } | ||
| 713 | } | ||
| 714 | |||
| 715 | [Fact] | ||
| 684 | public void PopulatesUpgradeTableFromManualUpgrade() | 716 | public void PopulatesUpgradeTableFromManualUpgrade() |
| 685 | { | 717 | { |
| 686 | var folder = TestData.Get(@"TestData\ManualUpgrade"); | 718 | var folder = TestData.Get(@"TestData\ManualUpgrade"); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/TypeLib/Language0.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/TypeLib/Language0.wxs new file mode 100644 index 00000000..fa64f98f --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/TypeLib/Language0.wxs | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Fragment> | ||
| 4 | <ComponentGroup Id="ProductComponents"> | ||
| 5 | <Component Id="TypeLibComp" Directory="INSTALLFOLDER" Guid="E85CB46B-BC22-4943-B678-5E399CBE53A6"> | ||
| 6 | <File Source="test.txt" Name="TypeLibComp.txt"></File> | ||
| 7 | <TypeLib Id="765BE8EE-BD7F-491E-90D2-C5A972462B50" Advertise="yes" Language="0" /> | ||
| 8 | </Component> | ||
| 9 | </ComponentGroup> | ||
| 10 | </Fragment> | ||
| 11 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 0624f6ae..770f528a 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -114,6 +114,7 @@ | |||
| 114 | <Content Include="TestData\OverridableActions\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 114 | <Content Include="TestData\OverridableActions\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 115 | <Content Include="TestData\OverridableActions\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 115 | <Content Include="TestData\OverridableActions\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 116 | <Content Include="TestData\TextStyle\ColorNull.wxs" CopyToOutputDirectory="PreserveNewest" /> | 116 | <Content Include="TestData\TextStyle\ColorNull.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 117 | <Content Include="TestData\TypeLib\Language0.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 117 | <Content Include="TestData\Wixipl\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 118 | <Content Include="TestData\Wixipl\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
| 118 | <Content Include="TestData\Wixipl\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 119 | <Content Include="TestData\Wixipl\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 119 | <Content Include="TestData\Wixipl\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 120 | <Content Include="TestData\Wixipl\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs index 88491eac..061eae07 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs | |||
| @@ -21,18 +21,19 @@ namespace WixToolsetTest.CoreIntegration | |||
| 21 | { | 21 | { |
| 22 | var baseFolder = fs.GetFolder(); | 22 | var baseFolder = fs.GetFolder(); |
| 23 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 23 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
| 24 | var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib"); | ||
| 24 | 25 | ||
| 25 | var result = WixRunner.Execute(new[] | 26 | var result = WixRunner.Execute(new[] |
| 26 | { | 27 | { |
| 27 | "build", | 28 | "build", |
| 28 | Path.Combine(folder, "DetectOnly.wxs"), | 29 | Path.Combine(folder, "DetectOnly.wxs"), |
| 29 | "-intermediateFolder", intermediateFolder, | 30 | "-intermediateFolder", intermediateFolder, |
| 30 | "-o", Path.Combine(intermediateFolder, @"test.wixlib"), | 31 | "-o", wixlibPath, |
| 31 | }); | 32 | }); |
| 32 | 33 | ||
| 33 | result.AssertSuccess(); | 34 | result.AssertSuccess(); |
| 34 | 35 | ||
| 35 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wixlib")); | 36 | var intermediate = Intermediate.Load(wixlibPath); |
| 36 | var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); | 37 | var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); |
| 37 | var wixSimpleRefTuples = allTuples.OfType<WixSimpleReferenceTuple>(); | 38 | var wixSimpleRefTuples = allTuples.OfType<WixSimpleReferenceTuple>(); |
| 38 | var repRef = wixSimpleRefTuples.Where(t => t.Table == "WixAction" && | 39 | var repRef = wixSimpleRefTuples.Where(t => t.Table == "WixAction" && |
| @@ -41,5 +42,40 @@ namespace WixToolsetTest.CoreIntegration | |||
| 41 | Assert.NotNull(repRef); | 42 | Assert.NotNull(repRef); |
| 42 | } | 43 | } |
| 43 | } | 44 | } |
| 45 | |||
| 46 | [Fact(Skip = "Test demonstrates failure")] | ||
| 47 | public void TypeLibLanguageAsStringReturnsZero() | ||
| 48 | { | ||
| 49 | var folder = TestData.Get(@"TestData\TypeLib"); | ||
| 50 | |||
| 51 | using (var fs = new DisposableFileSystem()) | ||
| 52 | { | ||
| 53 | var baseFolder = fs.GetFolder(); | ||
| 54 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 55 | var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib"); | ||
| 56 | |||
| 57 | var result = WixRunner.Execute(new[] | ||
| 58 | { | ||
| 59 | "build", | ||
| 60 | Path.Combine(folder, "Language0.wxs"), | ||
| 61 | "-intermediateFolder", intermediateFolder, | ||
| 62 | "-o", wixlibPath | ||
| 63 | }); | ||
| 64 | |||
| 65 | result.AssertSuccess(); | ||
| 66 | |||
| 67 | var intermediate = Intermediate.Load(wixlibPath); | ||
| 68 | var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); | ||
| 69 | var typeLibTuple = allTuples.OfType<TypeLibTuple>() | ||
| 70 | .SingleOrDefault(); | ||
| 71 | Assert.NotNull(typeLibTuple); | ||
| 72 | |||
| 73 | var fields = typeLibTuple.Fields.Select(field => field?.Type == IntermediateFieldType.Bool | ||
| 74 | ? field.AsNullableNumber()?.ToString() | ||
| 75 | : field?.AsString()) | ||
| 76 | .ToList(); | ||
| 77 | Assert.Equal("0", fields[1]); | ||
| 78 | } | ||
| 79 | } | ||
| 44 | } | 80 | } |
| 45 | } | 81 | } |
