##// END OF EJS Templates
tests: add coverage to ensure Wix tracks 'help' and 'templates' files...
tests: add coverage to ensure Wix tracks 'help' and 'templates' files This would have caught the problem fixed by 65d2538ac993. There are other *.wxs files that can be checked, but they appear to be more complicated. For example, locale.wxs has what appears to be foreach loop support, as well as variable substitution. By checking `hg files` to determine tracked file, this is able to avoid false failures when other junk is present in the filesystem, like *.orig files. I can't tell if the map-cmdline.status file is not included on purpose, but I don't see the purpose of excluding it. The missing help files seem reasonable for Windows.

File last commit:

r27383:b1160299 default
r27383:b1160299 default
Show More
test-install.t
111 lines | 3.4 KiB | text/troff | Tads3Lexer
Pradeepkumar Gayam
tests: unify test-install
r11917 hg debuginstall
$ hg debuginstall
Martin Geisler
debuginstall: lowercase status messages
r16934 checking encoding (ascii)...
Matt Mackall
debuginstall: change showing to checking for consistency and future checking
r20741 checking Python executable (*) (glob)
checking Python version (2.*) (glob)
Adrian Buehlmann
debuginstall: show directory for Python lib...
r17392 checking Python lib (*lib*)... (glob)
Martin Geisler
debuginstall: lowercase status messages
r16934 checking installed modules (*mercurial)... (glob)
checking templates (*mercurial?templates)... (glob)
checking commit editor...
checking username...
no problems detected
Pradeepkumar Gayam
tests: unify test-install
r11917
hg debuginstall with no username
$ HGUSER= hg debuginstall
Martin Geisler
debuginstall: lowercase status messages
r16934 checking encoding (ascii)...
Matt Mackall
debuginstall: change showing to checking for consistency and future checking
r20741 checking Python executable (*) (glob)
checking Python version (2.*) (glob)
Adrian Buehlmann
debuginstall: show directory for Python lib...
r17392 checking Python lib (*lib*)... (glob)
Martin Geisler
debuginstall: lowercase status messages
r16934 checking installed modules (*mercurial)... (glob)
checking templates (*mercurial?templates)... (glob)
checking commit editor...
checking username...
Matt Mackall
ui: suggest config --edit when no username is set
r20574 no username supplied
Martin Geisler
Merge with stable
r12084 (specify a username in your configuration file)
Pradeepkumar Gayam
tests: unify test-install
r11917 1 problems detected, please check your install!
Matt Mackall
tests: add exit codes to unified tests
r12316 [1]
Matt Harbison
debuginstall: expand the editor path before searching for it (issue4380)...
r24891
path variables are expanded (~ is the same as $TESTTMP)
$ mkdir tools
$ touch tools/testeditor.exe
#if execbit
$ chmod 755 tools/testeditor.exe
#endif
$ hg debuginstall --config ui.editor=~/tools/testeditor.exe
checking encoding (ascii)...
checking Python executable (*) (glob)
checking Python version (*) (glob)
checking Python lib (*lib*)... (glob)
checking installed modules (*mercurial)... (glob)
checking templates (*mercurial?templates)... (glob)
checking commit editor...
checking username...
no problems detected
Matt Harbison
tests: add coverage to ensure Wix tracks 'help' and 'templates' files...
r27383
$ cat >> wixxml.py << EOF
> import os, subprocess, sys
> import xml.etree.ElementTree as ET
>
> # MSYS mangles the path if it expands $TESTDIR
> testdir = os.environ['TESTDIR']
> ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
>
> def directory(node, relpath):
> '''generator of files in the xml node, rooted at relpath'''
> dirs = node.findall('./wix:Directory', ns)
>
> for d in dirs:
> for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
> yield subfile
>
> files = node.findall('./wix:Component/wix:File', ns)
>
> for f in files:
> yield relpath + f.attrib['Name']
>
> def hgdirectory(relpath):
> '''generator of tracked files, rooted at relpath'''
> hgdir = "%s/../mercurial" % (testdir)
> args = ['hg', '--cwd', hgdir, 'files', '--rev', '.', relpath]
> proc = subprocess.Popen(args, stdout=subprocess.PIPE,
> stderr=subprocess.PIPE)
> output = proc.communicate()[0]
>
> slash = '/'
> for line in output.splitlines():
> if os.name == 'nt':
> yield line.replace(os.sep, slash)
> else:
> yield line
>
> tracked = [f for f in hgdirectory(sys.argv[1])]
>
> xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
> root = xml.getroot()
> dir = root.find('.//wix:DirectoryRef', ns)
>
> installed = [f for f in directory(dir, '')]
>
> print('Not installed:')
> for f in sorted(set(tracked) - set(installed)):
> print(' %s' % f)
>
> print('Not tracked:')
> for f in sorted(set(installed) - set(tracked)):
> print(' %s' % f)
> EOF
$ python wixxml.py help
Not installed:
help/common.txt
help/hg.1.txt
help/hgignore.5.txt
help/hgrc.5.txt
help/internals/bundles.txt
help/internals/changegroups.txt
Not tracked:
$ python wixxml.py templates
Not installed:
templates/map-cmdline.status
Not tracked: