diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-12-02 00:46:11 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-12-02 00:46:11 -0800 |
| commit | 95f2f4425b900374c7d7b583ae810b096121b3c4 (patch) | |
| tree | 0ede0972e849bdc2c57e9535e31fbdd0df113f8d /src/test/WixToolsetTest.CoreIntegration | |
| parent | 720c4a0db1a2fb2aa3e08e5c99d5198873e448ba (diff) | |
| download | wix-95f2f4425b900374c7d7b583ae810b096121b3c4.tar.gz wix-95f2f4425b900374c7d7b583ae810b096121b3c4.tar.bz2 wix-95f2f4425b900374c7d7b583ae810b096121b3c4.zip | |
Implement support for IExtensionCommandLine and IPreprocessorExtension
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | 43 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/ExampleExtension/Package.wxs | 2 |
2 files changed, 45 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index 5181c748..6acf3472 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | |||
| @@ -56,5 +56,48 @@ namespace WixToolsetTest.CoreIntegration | |||
| 56 | Assert.Equal("Bar", example[1].AsString()); | 56 | Assert.Equal("Bar", example[1].AsString()); |
| 57 | } | 57 | } |
| 58 | } | 58 | } |
| 59 | |||
| 60 | [Fact] | ||
| 61 | public void CanParseCommandLineWithExtension() | ||
| 62 | { | ||
| 63 | var folder = TestData.Get(@"TestData\ExampleExtension"); | ||
| 64 | var extensionPath = Path.GetFullPath(new Uri(typeof(ExampleExtensionFactory).Assembly.CodeBase).LocalPath); | ||
| 65 | |||
| 66 | using (var fs = new DisposableFileSystem()) | ||
| 67 | { | ||
| 68 | var intermediateFolder = fs.GetFolder(); | ||
| 69 | |||
| 70 | var program = new Program(); | ||
| 71 | var result = program.Run(new WixToolsetServiceProvider(), new[] | ||
| 72 | { | ||
| 73 | "build", | ||
| 74 | Path.Combine(folder, "Package.wxs"), | ||
| 75 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 76 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 77 | "-ext", extensionPath, | ||
| 78 | "-bindpath", Path.Combine(folder, "data"), | ||
| 79 | "-intermediateFolder", intermediateFolder, | ||
| 80 | "-example", "test", | ||
| 81 | "-o", Path.Combine(intermediateFolder, @"bin\extest.msi") | ||
| 82 | }); | ||
| 83 | |||
| 84 | Assert.Equal(0, result); | ||
| 85 | |||
| 86 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\extest.msi"))); | ||
| 87 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\extest.wixpdb"))); | ||
| 88 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\MsiPackage\example.txt"))); | ||
| 89 | |||
| 90 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\extest.wir")); | ||
| 91 | var section = intermediate.Sections.Single(); | ||
| 92 | |||
| 93 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | ||
| 94 | Assert.Equal(Path.Combine(folder, @"data\example.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
| 95 | Assert.Equal(@"example.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
| 96 | |||
| 97 | var property = section.Tuples.OfType<PropertyTuple>().Where(p => p.Id.Id == "ExampleProperty").Single(); | ||
| 98 | Assert.Equal("ExampleProperty", property.Property); | ||
| 99 | Assert.Equal("test", property.Value); | ||
| 100 | } | ||
| 101 | } | ||
| 59 | } | 102 | } |
| 60 | } | 103 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ExampleExtension/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ExampleExtension/Package.wxs index cdc323ec..9fd42214 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/ExampleExtension/Package.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ExampleExtension/Package.wxs | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | 6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> |
| 7 | <MediaTemplate /> | 7 | <MediaTemplate /> |
| 8 | 8 | ||
| 9 | <Property Id="ExampleProperty" Value="$(ex.Test)" /> | ||
| 10 | |||
| 9 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | 11 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> |
| 10 | <ComponentGroupRef Id="ProductComponents" /> | 12 | <ComponentGroupRef Id="ProductComponents" /> |
| 11 | </Feature> | 13 | </Feature> |
