summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-01-09 16:29:37 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2013-01-09 18:04:19 +0100
commit549146755c4a510dd3fd8db87724c3b573927d89 (patch)
tree90d6a74f84fcc0083a2f48978687fb5a1f296fcf /tests
parent06c962631abee5d0fc59cdabf186f9cd003a461b (diff)
parentb57de2196e111605812cc3aff4d6dcb53ec8965d (diff)
downloadmsitools-549146755c4a510dd3fd8db87724c3b573927d89.tar.gz
msitools-549146755c4a510dd3fd8db87724c3b573927d89.tar.xz
msitools-549146755c4a510dd3fd8db87724c3b573927d89.zip
Merge remote-tracking branch 'wixl/master'
Diffstat (limited to 'tests')
-rw-r--r--tests/data/wixl/FoobarAppl10.exe1
-rw-r--r--tests/data/wixl/Helper.dll1
-rw-r--r--tests/data/wixl/Manual.pdf1
-rwxr-xr-xtests/data/wixl/Manual.wxs14
-rw-r--r--tests/data/wixl/SampleFirst.wxs61
-rwxr-xr-xtests/data/wixl/SampleFragment.wxs61
-rw-r--r--tests/data/wixl/test-arp.wxs45
-rw-r--r--tests/testsuite.at2
-rw-r--r--tests/wixl.at95
9 files changed, 281 insertions, 0 deletions
diff --git a/tests/data/wixl/FoobarAppl10.exe b/tests/data/wixl/FoobarAppl10.exe
new file mode 100644
index 0000000..c1b0730
--- /dev/null
+++ b/tests/data/wixl/FoobarAppl10.exe
@@ -0,0 +1 @@
+x \ No newline at end of file
diff --git a/tests/data/wixl/Helper.dll b/tests/data/wixl/Helper.dll
new file mode 100644
index 0000000..c1b0730
--- /dev/null
+++ b/tests/data/wixl/Helper.dll
@@ -0,0 +1 @@
+x \ No newline at end of file
diff --git a/tests/data/wixl/Manual.pdf b/tests/data/wixl/Manual.pdf
new file mode 100644
index 0000000..56a6051
--- /dev/null
+++ b/tests/data/wixl/Manual.pdf
@@ -0,0 +1 @@
+1 \ No newline at end of file
diff --git a/tests/data/wixl/Manual.wxs b/tests/data/wixl/Manual.wxs
new file mode 100755
index 0000000..e767d58
--- /dev/null
+++ b/tests/data/wixl/Manual.wxs
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='windows-1252'?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+ <Fragment Id='FragmentManual'>
+
+ <DirectoryRef Id='INSTALLDIR'>
+ <Component Id='Manual' Guid='ABCDDCBA-574D-4A9A-A266-5B5EC2C022A4'>
+ <File Id='Manual' Name='Manual.pdf' DiskId='1' Source='Manual.pdf' KeyPath='yes'>
+ <Shortcut Id="startmenuManual" Directory="ProgramMenuDir" Name="Instruction Manual" Advertise="yes" />
+ </File>
+ </Component>
+ </DirectoryRef>
+
+ </Fragment>
+</Wix>
diff --git a/tests/data/wixl/SampleFirst.wxs b/tests/data/wixl/SampleFirst.wxs
new file mode 100644
index 0000000..604eb0b
--- /dev/null
+++ b/tests/data/wixl/SampleFirst.wxs
@@ -0,0 +1,61 @@
+<?xml version='1.0' encoding='windows-1252'?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+ <Product Name='Foobar 1.0' Id='ABCDDCBA-86C7-4D14-AEC0-86416A69ABDE' UpgradeCode='ABCDDCBA-7349-453F-94F6-BCB5110BA4FD'
+ Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Acme Ltd.'>
+
+ <Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0 Installer"
+ Comments='Foobar is a registered trademark of Acme Ltd.' Manufacturer='Acme Ltd.'
+ InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+
+ <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
+ <Property Id='DiskPrompt' Value="Acme's Foobar 1.0 Installation [1]" />
+
+ <Directory Id='TARGETDIR' Name='SourceDir'>
+ <Directory Id='ProgramFilesFolder' Name='PFiles'>
+ <Directory Id='Acme' Name='Acme'>
+ <Directory Id='INSTALLDIR' Name='Foobar 1.0'>
+
+ <Component Id='MainExecutable' Guid='ABCDDCBA-83F1-4F22-985B-FDB3C8ABD471'>
+ <File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
+ <Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
+ <Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
+ </File>
+ </Component>
+
+ <Component Id='HelperLibrary' Guid='ABCDDCBA-6BE3-460D-A14F-75658D16550B'>
+ <File Id='HelperDLL' Name='Helper.dll' DiskId='1' Source='Helper.dll' KeyPath='yes' />
+ </Component>
+
+ <Component Id='Manual' Guid='ABCDDCBA-574D-4A9A-A266-5B5EC2C022A4'>
+ <File Id='Manual' Name='Manual.pdf' DiskId='1' Source='Manual.pdf' KeyPath='yes'>
+ <Shortcut Id="startmenuManual" Directory="ProgramMenuDir" Name="Instruction Manual" Advertise="yes" />
+ </File>
+ </Component>
+
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <Directory Id="ProgramMenuFolder" Name="Programs">
+ <Directory Id="ProgramMenuDir" Name="Foobar 1.0">
+ <Component Id="ProgramMenuDir" Guid="ABCDDCBA-7E98-44CE-B049-C477CC0A2B00">
+ <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
+ <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
+ </Component>
+ </Directory>
+ </Directory>
+
+ <Directory Id="DesktopFolder" Name="Desktop" />
+ </Directory>
+
+ <Feature Id='Complete' Level='1'>
+ <ComponentRef Id='MainExecutable' />
+ <ComponentRef Id='HelperLibrary' />
+ <ComponentRef Id='Manual' />
+ <ComponentRef Id='ProgramMenuDir' />
+ </Feature>
+
+ <Icon Id="Foobar10.exe" SourceFile="FoobarAppl10.exe" />
+
+ </Product>
+</Wix>
diff --git a/tests/data/wixl/SampleFragment.wxs b/tests/data/wixl/SampleFragment.wxs
new file mode 100755
index 0000000..42f1718
--- /dev/null
+++ b/tests/data/wixl/SampleFragment.wxs
@@ -0,0 +1,61 @@
+<?xml version='1.0' encoding='windows-1252'?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+ <Product Name='Foobar 1.0' Id='ABCDDCBA-86C7-4D14-AEC0-86416A69ABDE' UpgradeCode='ABCDDCBA-7349-453F-94F6-BCB5110BA4FD'
+ Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Acme Ltd.'>
+
+ <Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0 Installer"
+ Comments='Foobar is a registered trademark of Acme Ltd.' Manufacturer='Acme Ltd.'
+ InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+
+ <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
+ <Property Id='DiskPrompt' Value="Acme's Foobar 1.0 Installation [1]" />
+
+ <Directory Id='TARGETDIR' Name='SourceDir'>
+ <Directory Id='ProgramFilesFolder' Name='PFiles'>
+ <Directory Id='Acme' Name='Acme'>
+ <Directory Id='INSTALLDIR' Name='Foobar 1.0'>
+
+ <Component Id='MainExecutable' Guid='ABCDDCBA-83F1-4F22-985B-FDB3C8ABD471'>
+ <File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
+ <Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
+ <Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
+ </File>
+ </Component>
+
+ <Component Id='HelperLibrary' Guid='ABCDDCBA-6BE3-460D-A14F-75658D16550B'>
+ <File Id='HelperDLL' Name='Helper.dll' DiskId='1' Source='Helper.dll' KeyPath='yes' />
+ </Component>
+
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <Directory Id="ProgramMenuFolder" Name="Programs">
+ <Directory Id="ProgramMenuDir" Name="Foobar 1.0">
+ <Component Id="ProgramMenuDir" Guid="ABCDDCBA-7E98-44CE-B049-C477CC0A2B00">
+ <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
+ <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
+ </Component>
+ </Directory>
+ </Directory>
+
+ <Directory Id="DesktopFolder" Name="Desktop" />
+ </Directory>
+
+ <Feature Id='Complete' Title='Foobar 1.0' Description='The complete package.'
+ Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
+ <Feature Id='MainProgram' Title='Program' Description='The main executable.' Level='1'>
+ <ComponentRef Id='MainExecutable' />
+ <ComponentRef Id='HelperLibrary' />
+ <ComponentRef Id='ProgramMenuDir' />
+ </Feature>
+
+ <Feature Id='Documentation' Title='Description' Description='The instruction manual.' Level='1'>
+ <ComponentRef Id='Manual' />
+ </Feature>
+ </Feature>
+
+ <Icon Id="Foobar10.exe" SourceFile="FoobarAppl10.exe" />
+
+ </Product>
+</Wix>
diff --git a/tests/data/wixl/test-arp.wxs b/tests/data/wixl/test-arp.wxs
new file mode 100644
index 0000000..3e135ee
--- /dev/null
+++ b/tests/data/wixl/test-arp.wxs
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<?define Version = "0.2.0"?>
+<?define UpgradeCode = "ABCDDCBA-8392-0202-1993-199374829923"?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+
+ <Product Id="*" Name="name" Manufacturer="manufacturer"
+ Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)"
+ Language="1033">
+
+ <Package InstallerVersion="200" Compressed="yes" Comments="comments"/>
+ <Media Id="1" Cabinet="cabinet.cab" EmbedCab="yes"/>
+
+ <Property Id="ARPHELPLINK" Value="http://www.foobar.baz"/>
+ <Property Id="ARPNOMODIFY" Value="1"/>
+ <Property Id="ARPNOREPAIR" Value="1"/>
+ <Property Id="ARPPRODUCTICON" Value="FoobarAppl10.exe"/>
+ <Property Id="ARPURLINFOABOUT" Value="http://www.foobar.baz/info"/>
+ <Upgrade Id="$(var.UpgradeCode)">
+ <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
+ <UpgradeVersion Minimum="0.0.0" Maximum="$(var.Version)" IncludeMinimum="yes" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED"/>
+ </Upgrade>
+ <Condition Message="A newer version is already installed.">NOT NEWERVERSIONDETECTED</Condition>
+
+ <Directory Id="TARGETDIR" Name="SourceDir">
+ <Directory Id="ProgramFilesFolder">
+ <Directory Id="INSTALLDIR" Name="Example">
+ <Component Id="MainExecutable" Guid="ABCDDCBA-2034-1019-3233-949940039491">
+ <File Id="FoobarAppl10.exe" Source="FoobarAppl10.exe"/>
+ </Component>
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <Feature Id="Complete" Level="1">
+ <ComponentRef Id="MainExecutable"/>
+ </Feature>
+
+ <InstallExecuteSequence>
+ <RemoveExistingProducts After="InstallValidate"/>
+ </InstallExecuteSequence>
+
+ <Icon Id="FoobarAppl10.exe" SourceFile="FoobarAppl10.exe"/>
+
+ </Product>
+</Wix>
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 01ac62b..c48c5d1 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -231,3 +231,5 @@ Application: Windows Installer XML (3.7.1119.0)
Security: 2 (2)
])
AT_CLEANUP
+
+m4_include([wixl.at])
diff --git a/tests/wixl.at b/tests/wixl.at
new file mode 100644
index 0000000..0191012
--- /dev/null
+++ b/tests/wixl.at
@@ -0,0 +1,95 @@
+AT_BANNER([wixl])
+
+# AT_CHECK_... - add exeext automatically
+m4_define([AT_CHECK_WIXL], [
+AT_CHECK([_wixl ]$@)])
+
+# AT_WIXLDATA - copy data file from source tree
+m4_define([AT_WIXLDATA], [
+dir=`dirname $1`
+AS_MKDIR_P([$dir])
+AT_CHECK([cp $abs_srcdir/tests/data/wixl/$1 $1])])
+
+
+AT_SETUP([Invalid command line])
+AT_CHECK_WIXL([], [1], [ignore], [ignore])
+AT_CHECK_WIXL([out.msi foo.wxs], [1], [ignore], [ignore])
+AT_CHECK_WIXL([-o out.msi], [1], [ignore], [ignore])
+AT_CHECK_WIXL([-E], [1], [ignore], [ignore])
+AT_CHECK_WIXL([-D], [1], [ignore], [ignore])
+AT_CHECK_WIXL([-E -o out.msi], [1], [ignore], [ignore])
+AT_CHECK([test -f out.msi], [1])
+AT_CLEANUP
+
+AT_SETUP([WiX tutorial SampleFirst])
+AT_WIXLDATA([SampleFirst.wxs])
+AT_WIXLDATA([FoobarAppl10.exe])
+AT_WIXLDATA([Helper.dll])
+AT_WIXLDATA([Manual.pdf])
+AT_CHECK_WIXL([-o out.msi SampleFirst.wxs], [0], [ignore], [ignore])
+# FIXME: add tons of tests on out.msi
+AT_CHECK([test -f out.msi], [0])
+AT_CLEANUP
+
+AT_SETUP([WiX tutorial SampleFragment])
+AT_WIXLDATA([SampleFragment.wxs])
+AT_WIXLDATA([Manual.wxs])
+AT_WIXLDATA([FoobarAppl10.exe])
+AT_WIXLDATA([Helper.dll])
+AT_WIXLDATA([Manual.pdf])
+AT_CHECK_WIXL([-o out.msi SampleFragment.wxs Manual.wxs], [0], [ignore], [ignore])
+# FIXME: add tons of tests on out.msi
+AT_CHECK([test -f out.msi], [0])
+AT_CLEANUP
+
+AT_SETUP([Preprocessor variables])
+export MY_VAR="Hello!"
+AT_DATA([variables.wxs], [<?xml version="1.0"?>
+<?define Version = "0.2.0"?>
+<?define UpgradeCode = "ABCDDCBA-8392-0202-1993-199374829923"?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+ <Property Id="Id0" Value="$(var.UpgradeCode)"/>
+ <Property Id="Id0.1" Value="$$(var.UpgradeCode)"/>
+ <Property Id="Id0.2" Value="$$$(var.UpgradeCode)"/>
+ <?define UpgradeCode = "ABCDDCBA-8392-0202-1993-199374829924"?>
+ <Property Id="Id2" Value="$(var.UpgradeCode)"/>
+ <Property Id="Id3" Value="$(var.Version)"/>
+ <?define A = "A"?><?define B = "B"?>
+ <Property Id="IdAB" Value="$(var.A)$(var.B)"/>
+ <Property Id="IdHello" Value="$(env.MY_VAR)"/>
+ <Property Id="IdSys" Value="($(sys.SOURCEFILEDIR))foo"/>
+</Wix>
+])
+AT_CHECK_WIXL([-E variables.wxs], [0], [<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Property Id="Id0" Value="ABCDDCBA-8392-0202-1993-199374829923"/>
+ <Property Id="Id0.1" Value="$ABCDDCBA-8392-0202-1993-199374829923"/>
+ <Property Id="Id0.2" Value="$$ABCDDCBA-8392-0202-1993-199374829923"/>
+ <Property Id="Id2" Value="ABCDDCBA-8392-0202-1993-199374829924"/>
+ <Property Id="Id3" Value="0.2.0"/>
+ <Property Id="IdAB" Value="AB"/>
+ <Property Id="IdHello" Value="Hello!"/>
+ <Property Id="IdSys" Value="(variables.wxs)foo"/>
+</Wix>
+], [ignore])
+AT_DATA([variables.wxs], [<?xml version="1.0"?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+ <Property Id="Id$(var.Foo)" Value="$(var.Foo)"/>
+ <Property Id="Id$(var.Zig)" Value="$(var.Zig)"/>
+</Wix>
+])
+AT_CHECK_WIXL([-E variables.wxs -D Foo -D Zig=Zag], [0], [<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Property Id="Id1" Value="1"/>
+ <Property Id="IdZag" Value="Zag"/>
+</Wix>
+], [ignore])
+AT_CLEANUP
+
+AT_SETUP([ARP example])
+AT_WIXLDATA([test-arp.wxs])
+AT_WIXLDATA([FoobarAppl10.exe])
+AT_CHECK_WIXL([-o out.msi test-arp.wxs], [0], [ignore], [ignore])
+# FIXME: add tons of tests on out.msi
+AT_CHECK([test -f out.msi], [0])
+AT_CLEANUP