##// END OF EJS Templates
tests: python executable should always be globbed...
Sean Farley -
r28626:60ee2593 default
parent child Browse files
Show More
@@ -1,138 +1,138 b''
1 1 hg debuginstall
2 2 $ hg debuginstall
3 3 checking encoding (ascii)...
4 4 checking Python executable (*) (glob)
5 5 checking Python version (2.*) (glob)
6 6 checking Python lib (*lib*)... (glob)
7 7 checking installed modules (*mercurial)... (glob)
8 8 checking templates (*mercurial?templates)... (glob)
9 9 checking default template (*mercurial?templates?map-cmdline.default) (glob)
10 checking commit editor... (*python* -c "import sys; sys.exit(0)") (glob)
10 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
11 11 checking username (test)
12 12 no problems detected
13 13
14 14 hg debuginstall JSON
15 15 $ hg debuginstall -Tjson
16 16 [
17 17 {
18 18 "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob)
19 19 "defaulttemplateerror": null,
20 20 "defaulttemplatenotfound": "default",
21 "editor": "*python* -c \"import sys; sys.exit(0)\"", (glob)
21 "editor": "* -c \"import sys; sys.exit(0)\"", (glob)
22 22 "editornotfound": false,
23 23 "encoding": "ascii",
24 24 "encodingerror": null,
25 25 "extensionserror": null,
26 26 "hgmodules": "*mercurial", (glob)
27 27 "problems": 0,
28 28 "pythonexe": "*", (glob)
29 "pythonlib": "*python*", (glob)
29 "pythonlib": "*", (glob)
30 30 "pythonver": "*.*.*", (glob)
31 31 "templatedirs": "*mercurial?templates", (glob)
32 32 "username": "test",
33 33 "usernameerror": null,
34 34 "vinotfound": false
35 35 }
36 36 ]
37 37
38 38 hg debuginstall with no username
39 39 $ HGUSER= hg debuginstall
40 40 checking encoding (ascii)...
41 41 checking Python executable (*) (glob)
42 42 checking Python version (2.*) (glob)
43 43 checking Python lib (*lib*)... (glob)
44 44 checking installed modules (*mercurial)... (glob)
45 45 checking templates (*mercurial?templates)... (glob)
46 46 checking default template (*mercurial?templates?map-cmdline.default) (glob)
47 checking commit editor... (*python* -c "import sys; sys.exit(0)") (glob)
47 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
48 48 checking username...
49 49 no username supplied
50 50 (specify a username in your configuration file)
51 51 1 problems detected, please check your install!
52 52 [1]
53 53
54 54 path variables are expanded (~ is the same as $TESTTMP)
55 55 $ mkdir tools
56 56 $ touch tools/testeditor.exe
57 57 #if execbit
58 58 $ chmod 755 tools/testeditor.exe
59 59 #endif
60 60 $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
61 61 checking encoding (ascii)...
62 62 checking Python executable (*) (glob)
63 63 checking Python version (*) (glob)
64 64 checking Python lib (*lib*)... (glob)
65 65 checking installed modules (*mercurial)... (glob)
66 66 checking templates (*mercurial?templates)... (glob)
67 67 checking default template (*mercurial?templates?map-cmdline.default) (glob)
68 checking commit editor... (*python* -c "import sys; sys.exit(0)") (glob)
68 checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
69 69 checking username (test)
70 70 no problems detected
71 71
72 72 #if test-repo
73 73 $ cat >> wixxml.py << EOF
74 74 > import os, subprocess, sys
75 75 > import xml.etree.ElementTree as ET
76 76 >
77 77 > # MSYS mangles the path if it expands $TESTDIR
78 78 > testdir = os.environ['TESTDIR']
79 79 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
80 80 >
81 81 > def directory(node, relpath):
82 82 > '''generator of files in the xml node, rooted at relpath'''
83 83 > dirs = node.findall('./{%(wix)s}Directory' % ns)
84 84 >
85 85 > for d in dirs:
86 86 > for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
87 87 > yield subfile
88 88 >
89 89 > files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns)
90 90 >
91 91 > for f in files:
92 92 > yield relpath + f.attrib['Name']
93 93 >
94 94 > def hgdirectory(relpath):
95 95 > '''generator of tracked files, rooted at relpath'''
96 96 > hgdir = "%s/../mercurial" % (testdir)
97 97 > args = ['hg', '--cwd', hgdir, 'files', relpath]
98 98 > proc = subprocess.Popen(args, stdout=subprocess.PIPE,
99 99 > stderr=subprocess.PIPE)
100 100 > output = proc.communicate()[0]
101 101 >
102 102 > slash = '/'
103 103 > for line in output.splitlines():
104 104 > if os.name == 'nt':
105 105 > yield line.replace(os.sep, slash)
106 106 > else:
107 107 > yield line
108 108 >
109 109 > tracked = [f for f in hgdirectory(sys.argv[1])]
110 110 >
111 111 > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
112 112 > root = xml.getroot()
113 113 > dir = root.find('.//{%(wix)s}DirectoryRef' % ns)
114 114 >
115 115 > installed = [f for f in directory(dir, '')]
116 116 >
117 117 > print('Not installed:')
118 118 > for f in sorted(set(tracked) - set(installed)):
119 119 > print(' %s' % f)
120 120 >
121 121 > print('Not tracked:')
122 122 > for f in sorted(set(installed) - set(tracked)):
123 123 > print(' %s' % f)
124 124 > EOF
125 125
126 126 $ python wixxml.py help
127 127 Not installed:
128 128 help/common.txt
129 129 help/hg.1.txt
130 130 help/hgignore.5.txt
131 131 help/hgrc.5.txt
132 132 Not tracked:
133 133
134 134 $ python wixxml.py templates
135 135 Not installed:
136 136 Not tracked:
137 137
138 138 #endif
General Comments 0
You need to be logged in to leave comments. Login now