annotate tests/test-mac-packages.t @ 30234:34a5f6c66bc5 stable

tests: invoke printenv.py via sh -c for test portability On Windows platform, invoking printenv.py directly via hook is problematic, because: - unless binding between *.py suffix and python runtime, application selector dialog is displayed, and running test is blocked at each printenv.py invocations - it isn't safe to assume binding between *.py suffix and python runtime, because application binding is easily broken For example, installing IDE (VisualStudio with Python Tools, or so) often requires binding between source files and IDE itself. This patch invokes printenv.py via sh -c for test portability. This is a kind of follow up for d19787db6fe0, which eliminated explicit "python" for printenv.py. There are already other 'sh -c "printenv.py"' in *.t files, and this fix should be reasonable. This changes were confirmed in cases below: - without any application binding for *.py suffix - with binding between *.py suffix and VisualStudio This patch also replaces "echo + redirection" style with "heredoc" style, because: - hook command line is parsed by cmd.exe as shell at first, and - single quotation can't quote arguments on cmd.exe, therefore, - "printenv.py foobar" should be quoted by double quotation, but - nested quoting (or tricky escaping) isn't readable
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 29 Oct 2016 02:44:45 +0900
parents da1848f07c6a
children 408dcf7475a7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
1 #require test-repo slow osx osxpackaging
29219
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 29027
diff changeset
2
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 29027
diff changeset
3 $ . "$TESTDIR/helpers-testrepo.sh"
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 29027
diff changeset
4
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
5 $ OUTPUTDIR=`pwd`
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
6 $ export OUTPUTDIR
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
7 $ KEEPMPKG=yes
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
8 $ export KEEPMPKG
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
9
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
10 $ cd "$TESTDIR"/..
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
11 $ rm -rf dist
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
12 $ make osx > $OUTPUTDIR/build.log 2>&1
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
13 $ cd $OUTPUTDIR
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
14 $ ls -d *.pkg
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
15 Mercurial-*-macosx10.*.pkg (glob)
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
16
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
17 $ xar -xf Mercurial*.pkg
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
18
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
19 Gather list of all installed files:
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
20 $ lsbom mercurial.pkg/Bom > boms.txt
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
21
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
22 Spot-check some randomly selected files:
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
23 $ grep bdiff boms.txt | cut -d ' ' -f 1,2,3
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
24 ./Library/Python/2.7/site-packages/mercurial/bdiff.so 100755 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
25 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.py 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
26 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyc 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
27 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
28 $ egrep 'man[15]' boms.txt | cut -d ' ' -f 1,2,3
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
29 ./usr/local/share/man/man1 40755 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
30 ./usr/local/share/man/man1/hg.1 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
31 ./usr/local/share/man/man5 40755 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
32 ./usr/local/share/man/man5/hgignore.5 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
33 ./usr/local/share/man/man5/hgrc.5 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
34 $ grep bser boms.txt | cut -d ' ' -f 1,2,3
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
35 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/bser.so 100755 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
36 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.py 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
37 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyc 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
38 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyo 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
39 $ grep localrepo boms.txt | cut -d ' ' -f 1,2,3
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
40 ./Library/Python/2.7/site-packages/mercurial/localrepo.py 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
41 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyc 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
42 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyo 100644 0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
43 $ grep '/hg ' boms.txt | cut -d ' ' -f 1,2,3
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
44 ./usr/local/bin/hg 100755 0/0
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
45
29535
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
46 Make sure the built binary uses the system Python interpreter
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
47 $ bsdtar xf mercurial.pkg/Payload usr/local/bin
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
48 Use a glob to find this to avoid check-code whining about a fixed path.
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
49 $ head -n 1 usr/local/b?n/hg
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
50 #!/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
51
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
52 Note that we're not currently installing any /etc/mercurial stuff,
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
53 including merge-tool configurations.