From e53afb01c6e01bb9e6521fa77d31e575abc73f9c Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 4 Dec 2017 18:33:11 -0500 Subject: Add CanBuildSingleFileCompressed test (failing variety). --- .../ProgramFixture.cs | 36 ++++++++++++++++++++++ .../SingleFileCompressed/Package.en-us.wxl | 11 +++++++ .../TestData/SingleFileCompressed/Package.wxs | 22 +++++++++++++ .../SingleFileCompressed/PackageComponents.wxs | 10 ++++++ .../TestData/SingleFileCompressed/data/test.txt | 1 + .../WixToolsetTest.CoreIntegration.csproj | 4 +++ 6 files changed, 84 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/data/test.txt (limited to 'src/test') diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs index e9e5c62f..6644fd33 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs @@ -48,6 +48,42 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void CanBuildSingleFileCompressed() + { + var folder = TestData.Get(@"TestData\SingleFileCompressed"); + + using (var fs = new DisposableFileSystem()) + { + var intermediateFolder = fs.GetFolder(); + + var program = new Program(); + var result = program.Run(new WixToolsetServiceProvider(), new[] + { + "build", + Path.Combine(folder, "Package.wxs"), + Path.Combine(folder, "PackageComponents.wxs"), + "-loc", Path.Combine(folder, "Package.en-us.wxl"), + "-bindpath", Path.Combine(folder, "data"), + "-intermediateFolder", intermediateFolder, + "-o", Path.Combine(intermediateFolder, @"bin\test.msi") + }); + + Assert.Equal(0, result); + + Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.msi"))); + Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.wixpdb"))); + Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\MsiPackage\test.txt"))); + + var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wir")); + Assert.Single(intermediate.Sections); + + var wixFile = intermediate.Sections.SelectMany(s => s.Tuples).OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); + } + } + [Fact] public void CanBuildSimpleModule() { diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.wxs new file mode 100644 index 00000000..3f47d01d --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index ede5967f..ed0d5f5e 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -23,6 +23,10 @@ + + + + -- cgit v1.2.3-55-g6feb