##// 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
@@ -1,43 +1,111 b''
1 hg debuginstall
1 hg debuginstall
2 $ hg debuginstall
2 $ hg debuginstall
3 checking encoding (ascii)...
3 checking encoding (ascii)...
4 checking Python executable (*) (glob)
4 checking Python executable (*) (glob)
5 checking Python version (2.*) (glob)
5 checking Python version (2.*) (glob)
6 checking Python lib (*lib*)... (glob)
6 checking Python lib (*lib*)... (glob)
7 checking installed modules (*mercurial)... (glob)
7 checking installed modules (*mercurial)... (glob)
8 checking templates (*mercurial?templates)... (glob)
8 checking templates (*mercurial?templates)... (glob)
9 checking commit editor...
9 checking commit editor...
10 checking username...
10 checking username...
11 no problems detected
11 no problems detected
12
12
13 hg debuginstall with no username
13 hg debuginstall with no username
14 $ HGUSER= hg debuginstall
14 $ HGUSER= hg debuginstall
15 checking encoding (ascii)...
15 checking encoding (ascii)...
16 checking Python executable (*) (glob)
16 checking Python executable (*) (glob)
17 checking Python version (2.*) (glob)
17 checking Python version (2.*) (glob)
18 checking Python lib (*lib*)... (glob)
18 checking Python lib (*lib*)... (glob)
19 checking installed modules (*mercurial)... (glob)
19 checking installed modules (*mercurial)... (glob)
20 checking templates (*mercurial?templates)... (glob)
20 checking templates (*mercurial?templates)... (glob)
21 checking commit editor...
21 checking commit editor...
22 checking username...
22 checking username...
23 no username supplied
23 no username supplied
24 (specify a username in your configuration file)
24 (specify a username in your configuration file)
25 1 problems detected, please check your install!
25 1 problems detected, please check your install!
26 [1]
26 [1]
27
27
28 path variables are expanded (~ is the same as $TESTTMP)
28 path variables are expanded (~ is the same as $TESTTMP)
29 $ mkdir tools
29 $ mkdir tools
30 $ touch tools/testeditor.exe
30 $ touch tools/testeditor.exe
31 #if execbit
31 #if execbit
32 $ chmod 755 tools/testeditor.exe
32 $ chmod 755 tools/testeditor.exe
33 #endif
33 #endif
34 $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
34 $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
35 checking encoding (ascii)...
35 checking encoding (ascii)...
36 checking Python executable (*) (glob)
36 checking Python executable (*) (glob)
37 checking Python version (*) (glob)
37 checking Python version (*) (glob)
38 checking Python lib (*lib*)... (glob)
38 checking Python lib (*lib*)... (glob)
39 checking installed modules (*mercurial)... (glob)
39 checking installed modules (*mercurial)... (glob)
40 checking templates (*mercurial?templates)... (glob)
40 checking templates (*mercurial?templates)... (glob)
41 checking commit editor...
41 checking commit editor...
42 checking username...
42 checking username...
43 no problems detected
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