diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-03-01 23:34:57 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-03-02 02:21:22 -0800 |
| commit | 7eab295351796e2b41c1805d027957e1a7d9ddc6 (patch) | |
| tree | e7c808ac19909fd9c14989d2ff3040ede2e5fe3d /src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | |
| parent | 3eb3c26c796984b64365fda077f173af8bf31559 (diff) | |
| download | wix-7eab295351796e2b41c1805d027957e1a7d9ddc6.tar.gz wix-7eab295351796e2b41c1805d027957e1a7d9ddc6.tar.bz2 wix-7eab295351796e2b41c1805d027957e1a7d9ddc6.zip | |
Correctly set the parent SourceLineNumber for include files
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs index aad3ed73..89057991 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | |||
| @@ -8,6 +8,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 8 | using WixToolset.Core; | 8 | using WixToolset.Core; |
| 9 | using WixToolset.Core.TestPackage; | 9 | using WixToolset.Core.TestPackage; |
| 10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
| 11 | using WixToolset.Data.Symbols; | ||
| 11 | using WixToolset.Extensibility.Data; | 12 | using WixToolset.Extensibility.Data; |
| 12 | using Xunit; | 13 | using Xunit; |
| 13 | 14 | ||
| @@ -40,6 +41,45 @@ namespace WixToolsetTest.CoreIntegration | |||
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | [Fact] | 43 | [Fact] |
| 44 | public void IncludeSourceLineNumbersPreserved() | ||
| 45 | { | ||
| 46 | var folder = TestData.Get(@"TestData\IncludePath"); | ||
| 47 | |||
| 48 | using (var fs = new DisposableFileSystem()) | ||
| 49 | { | ||
| 50 | var baseFolder = fs.GetFolder(); | ||
| 51 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 52 | |||
| 53 | var result = WixRunner.Execute(warningsAsErrors: false, new[] | ||
| 54 | { | ||
| 55 | "build", | ||
| 56 | Path.Combine(folder, "Package.wxs"), | ||
| 57 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 58 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 59 | "-includepath", Path.Combine(folder, "data"), | ||
| 60 | "-bindpath", Path.Combine(folder, "data"), | ||
| 61 | "-intermediateFolder", intermediateFolder, | ||
| 62 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
| 63 | }); | ||
| 64 | |||
| 65 | result.AssertSuccess(); | ||
| 66 | |||
| 67 | using (var output = WixOutput.Read(Path.Combine(baseFolder, @"bin\test.wixpdb"))) | ||
| 68 | { | ||
| 69 | var intermediate = Intermediate.Load(output); | ||
| 70 | var component = intermediate.Sections.Single().Symbols.OfType<ComponentSymbol>().Single(); | ||
| 71 | Assert.Equal(3, component.SourceLineNumbers.LineNumber); | ||
| 72 | Assert.Equal(5, component.SourceLineNumbers.Parent.LineNumber); | ||
| 73 | |||
| 74 | var encoded = component.SourceLineNumbers.GetEncoded(); | ||
| 75 | var decoded = SourceLineNumber.CreateFromEncoded(encoded); | ||
| 76 | Assert.Equal(3, decoded.LineNumber); | ||
| 77 | Assert.Equal(5, decoded.Parent.LineNumber); | ||
| 78 | } | ||
| 79 | } | ||
| 80 | } | ||
| 81 | |||
| 82 | [Fact] | ||
| 43 | /// <remarks> | 83 | /// <remarks> |
| 44 | /// This test will fail on 32-bit operating systems because it depends on "CommonProgramFiles(x86)" | 84 | /// This test will fail on 32-bit operating systems because it depends on "CommonProgramFiles(x86)" |
| 45 | /// which is only defined on 64-bit Windows. | 85 | /// which is only defined on 64-bit Windows. |
