##// END OF EJS Templates
tests: add coverage to ensure Wix tracks 'help' and 'templates' files...
Matt Harbison -
r27383:b1160299 default
parent child Browse files
Show More
@@ -41,3 +41,71 b' path variables are expanded (~ is the sa'
41 41 checking commit editor...
42 42 checking username...
43 43 no problems detected
44
45 $ cat >> wixxml.py << EOF
46 > import os, subprocess, sys
47 > import xml.etree.ElementTree as ET
48 >
49 > # MSYS mangles the path if it expands $TESTDIR
50 > testdir = os.environ['TESTDIR']
51 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
52 >
53 > def directory(node, relpath):
54 > '''generator of files in the xml node, rooted at relpath'''
55 > dirs = node.findall('./wix:Directory', ns)
56 >
57 > for d in dirs:
58 > for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
59 > yield subfile
60 >
61 > files = node.findall('./wix:Component/wix:File', ns)
62 >
63 > for f in files:
64 > yield relpath + f.attrib['Name']
65 >
66 > def hgdirectory(relpath):
67 > '''generator of tracked files, rooted at relpath'''
68 > hgdir = "%s/../mercurial" % (testdir)
69 > args = ['hg', '--cwd', hgdir, 'files', '--rev', '.', relpath]
70 > proc = subprocess.Popen(args, stdout=subprocess.PIPE,
71 > stderr=subprocess.PIPE)
72 > output = proc.communicate()[0]
73 >
74 > slash = '/'
75 > for line in output.splitlines():
76 > if os.name == 'nt':
77 > yield line.replace(os.sep, slash)
78 > else:
79 > yield line
80 >
81 > tracked = [f for f in hgdirectory(sys.argv[1])]
82 >
83 > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
84 > root = xml.getroot()
85 > dir = root.find('.//wix:DirectoryRef', ns)
86 >
87 > installed = [f for f in directory(dir, '')]
88 >
89 > print('Not installed:')
90 > for f in sorted(set(tracked) - set(installed)):
91 > print(' %s' % f)
92 >
93 > print('Not tracked:')
94 > for f in sorted(set(installed) - set(tracked)):
95 > print(' %s' % f)
96 > EOF
97
98 $ python wixxml.py help
99 Not installed:
100 help/common.txt
101 help/hg.1.txt
102 help/hgignore.5.txt
103 help/hgrc.5.txt
104 help/internals/bundles.txt
105 help/internals/changegroups.txt
106 Not tracked:
107
108 $ python wixxml.py templates
109 Not installed:
110 templates/map-cmdline.status
111 Not tracked:
General Comments 0
You need to be logged in to leave comments. Login now