| !tests/mbrola.test | !tests/mbrola.test | ||||
| !tests/dictionary.test | !tests/dictionary.test | ||||
| !tests/cmd_options.test | !tests/cmd_options.test | ||||
| !tests/windows-installer.test | |||||
| espeak-ng.pc | espeak-ng.pc | ||||
| tests/klatt.check \ | tests/klatt.check \ | ||||
| tests/mbrola.check \ | tests/mbrola.check \ | ||||
| tests/variants.check \ | tests/variants.check \ | ||||
| tests/windows-installer.check \ | |||||
| tests/bom.check \ | tests/bom.check \ | ||||
| tests/cmd_options.check | tests/cmd_options.check | ||||
| <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?> | <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?> | ||||
| <?endif ?> | <?endif ?> | ||||
| <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | ||||
| <Product Id="3DA6DF03-E5CD-4A93-B06F-707484742BAB" Name="$(var.ProductDisplayName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Cainteoir Technologies" UpgradeCode="B4F779EB-AC6C-49D2-A12D-4871E4520C0F"> | |||||
| <Product Id="3DA6DF03-E5CD-4A93-B06F-707484742BAB" Name="$(var.ProductDisplayName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="eSpeak Community" UpgradeCode="B4F779EB-AC6C-49D2-A12D-4871E4520C0F"> | |||||
| <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="$(var.Platform)" /> | <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="$(var.Platform)" /> | ||||
| <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||||
| <Component Id="it_dict" Win64="$(var.Win64)" Guid="A91D9D76-5BA7-45BB-B1B0-FF52EDA40141"> | <Component Id="it_dict" Win64="$(var.Win64)" Guid="A91D9D76-5BA7-45BB-B1B0-FF52EDA40141"> | ||||
| <File Name="it_dict" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\it_dict" KeyPath="yes"/> | <File Name="it_dict" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\it_dict" KeyPath="yes"/> | ||||
| </Component> | </Component> | ||||
| <Component Id="ja_dict" Win64="$(var.Win64)" Guid="BC2849B8-3F19-4543-B698-D53F43DEF831"> | |||||
| <File Name="ja_dict" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\ja_dict" KeyPath="yes"/> | |||||
| </Component> | |||||
| <Component Id="jbo_dict" Win64="$(var.Win64)" Guid="C1A9EB60-2825-460B-8F4F-E31610697BCE"> | <Component Id="jbo_dict" Win64="$(var.Win64)" Guid="C1A9EB60-2825-460B-8F4F-E31610697BCE"> | ||||
| <File Name="jbo_dict" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\jbo_dict" KeyPath="yes"/> | <File Name="jbo_dict" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\jbo_dict" KeyPath="yes"/> | ||||
| </Component> | </Component> | ||||
| <Component Id="ko" Win64="$(var.Win64)" Guid="0F759436-12BD-4FC5-80C0-6E755E021E40"> | <Component Id="ko" Win64="$(var.Win64)" Guid="0F759436-12BD-4FC5-80C0-6E755E021E40"> | ||||
| <File Name="ko" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\lang\ko" KeyPath="yes"/> | <File Name="ko" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\lang\ko" KeyPath="yes"/> | ||||
| </Component> | </Component> | ||||
| <Directory Id="JPX" Name="jpx"> | |||||
| <Component Id="ja" Win64="$(var.Win64)" Guid="00A542A4-48FD-450D-84F5-8035B0EB1FBB"> | |||||
| <File Name="ja" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\lang\jpx\ja" KeyPath="yes"/> | |||||
| </Component> | |||||
| </Directory> | |||||
| <Directory Id="POZ" Name="poz"> | <Directory Id="POZ" Name="poz"> | ||||
| <Component Id="id" Win64="$(var.Win64)" Guid="C9BFD2A4-A105-4061-961A-DF6CB6C02854"> | <Component Id="id" Win64="$(var.Win64)" Guid="C9BFD2A4-A105-4061-961A-DF6CB6C02854"> | ||||
| <File Name="id" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\lang\poz\id" KeyPath="yes"/> | <File Name="id" Source="$(var.ProjectDir)..\..\..\espeak-ng-data\lang\poz\id" KeyPath="yes"/> |
| #!/usr/bin/env python3 | |||||
| import sys | |||||
| import xml.etree.ElementTree as etree | |||||
| passed = True | |||||
| def check_result(check, message): | |||||
| global passed | |||||
| if check: | |||||
| print('passed') | |||||
| elif message: | |||||
| print('failed: ' + message) | |||||
| passed = False | |||||
| else: | |||||
| print('failed') | |||||
| passed = False | |||||
| def all_descendants(wix, name): | |||||
| for e in wix.iter(): | |||||
| if e.tag == '{http://schemas.microsoft.com/wix/2006/wi}' + name: | |||||
| yield e | |||||
| def children(e, name): | |||||
| for c in e: | |||||
| if not isinstance(c, str): | |||||
| if c.tag == '{http://schemas.microsoft.com/wix/2006/wi}' + name: | |||||
| yield c | |||||
| def element_map(wix, name): | |||||
| print('testing for duplicate \'' + name + '\' ids ... ', end='') | |||||
| items = {} | |||||
| duplicates = [] | |||||
| for e in all_descendants(wix, name): | |||||
| id = e.attrib.get("Id") | |||||
| if id in items.keys(): | |||||
| duplicates.append(id) | |||||
| else: | |||||
| items[id] = e | |||||
| check_result(len(duplicates) == 0 , ', '.join(duplicates)) | |||||
| return items | |||||
| def check_element_guids(wix, name): | |||||
| print('testing for duplicate \'' + name + '\' guids ... ', end='') | |||||
| guids = [] | |||||
| missing_guids = [] | |||||
| duplicates = [] | |||||
| for e in all_descendants(wix, name): | |||||
| id = e.attrib.get("Id") | |||||
| guid = e.attrib.get("Guid") | |||||
| if not guid: | |||||
| missing_guids.append(id) | |||||
| elif guid in guids: | |||||
| duplicates.append(guid) | |||||
| else: | |||||
| guids.append(guid) | |||||
| check_result(len(duplicates) == 0 , ', '.join(duplicates)) | |||||
| return (guids, missing_guids) | |||||
| def check_references(nodes, node_name, name, item_name, items): | |||||
| print('testing for missing \'' + item_name + '\' ids in \'' + node_name + '/' + name + '\' ... ', end='') | |||||
| missing = [] | |||||
| for node in nodes.values(): | |||||
| for ref in children(node, name): | |||||
| id = ref.attrib.get("Id") | |||||
| if not id in items.keys(): | |||||
| missing.append(id) | |||||
| check_result(len(missing) == 0 , ', '.join(missing)) | |||||
| # 1. Check for missing/duplicate ids ################################################################################### | |||||
| wix = etree.parse('src/windows/installer/Product.wxs').getroot() | |||||
| features = element_map(wix, 'Feature') | |||||
| component_groups = element_map(wix, 'ComponentGroup') | |||||
| components = element_map(wix, 'Component') | |||||
| directories = element_map(wix, 'Directory') | |||||
| check_references(features, 'Feature', 'ComponentGroupRef', 'ComponentGroup', component_groups) | |||||
| check_references(component_groups, 'ComponentGroups', 'ComponentRef', 'Component', components) | |||||
| # 2. Check for missing/duplicate guids ################################################################################# | |||||
| guids, missing_guids = check_element_guids(wix, 'Component') | |||||
| print('testing for missing \'Component\' guids ... ', end='') | |||||
| check_result(len(missing_guids) == 0 , ', '.join(missing_guids)) | |||||
| ######################################################################################################################## | |||||
| if not passed: | |||||
| sys.exit(-1) |