tests/test-mac-packages.t
author Adam Simpkins <simpkins@fb.com>
Tue, 27 Jun 2017 17:24:31 -0700
changeset 33116 6c113a7dec52
parent 32652 9929af2b09b4
child 33204 ddd65b4f3ae6
permissions -rw-r--r--
tests: use the system hg for examining the local repository Most test scripts use "hg" to interact with a temporary test repository. However a few tests also want to run hg commands to interact with the local repository containing the mercurial source code. Notably, many of the test-check-* tests want to check local files and commit messages. These tests were previously using the version of hg being tested to query the source repository. However, this will fail if the source repository requires extensions or other settings not supported by the version of mercurial being tested. The source repository was typically initially cloned using the system hg installation, so we should use the system hg installation to query it. There was already a helpers-testrepo.sh script designed to help cope with different requirements for the source repository versus the test repositories. However, it only handled the evolve extension. This new behavior works with any extensions that are different between the system installation and the test installation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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"
33116
6c113a7dec52 tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents: 32652
diff changeset
     4
  $ syshgenv
29219
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 29027
diff changeset
     5
31610
6dc8caccef8a osx: use more paranoid quoting in test
Augie Fackler <augie@google.com>
parents: 31609
diff changeset
     6
  $ OUTPUTDIR="`pwd`"
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
     7
  $ export OUTPUTDIR
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
  $ KEEPMPKG=yes
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
     9
  $ export KEEPMPKG
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    10
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    11
  $ cd "$TESTDIR"/..
31610
6dc8caccef8a osx: use more paranoid quoting in test
Augie Fackler <augie@google.com>
parents: 31609
diff changeset
    12
  $ make osx > "$OUTPUTDIR/build.log" 2>&1
6dc8caccef8a osx: use more paranoid quoting in test
Augie Fackler <augie@google.com>
parents: 31609
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
32575
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    22
We've had problems with the filter logic in the past. Make sure no
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    23
.DS_Store files ended up in the final package:
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    24
  $ grep DS_S boms.txt
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    25
  [1]
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    26
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    27
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
    28
  $ grep bdiff boms.txt | cut -d '	' -f 1,2,3
32470
0e93dc8c0f9f osx: update Mac packaging tests for bdiff.so install location change
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    29
  ./Library/Python/2.7/site-packages/mercurial/cext/bdiff.so	100755	0/0
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    30
  ./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
    31
  ./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
    32
  ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo	100644	0/0
32576
501d48bda912 zsh_completion: install as _hg not hg
Kyle Lippincott <spectral@google.com>
parents: 32575
diff changeset
    33
  $ grep zsh/site-functions/_hg boms.txt | cut -d '	' -f 1,2,3
501d48bda912 zsh_completion: install as _hg not hg
Kyle Lippincott <spectral@google.com>
parents: 32575
diff changeset
    34
  ./usr/local/share/zsh/site-functions/_hg	100644	0/0
31142
408dcf7475a7 osx: install bash and zsh completions by default
Augie Fackler <augie@google.com>
parents: 29535
diff changeset
    35
  $ grep hg-completion.bash boms.txt | cut -d '	' -f 1,2,3
31609
8e516f71577a osx: install completion scripts using install(1) to avoid umask badness
Augie Fackler <augie@google.com>
parents: 31142
diff changeset
    36
  ./usr/local/hg/contrib/hg-completion.bash	100644	0/0
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    37
  $ 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
    38
  ./usr/local/share/man/man1	40755	0/0
32472
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32471
diff changeset
    39
  ./usr/local/share/man/man1/chg.1	100644	0/0
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    40
  ./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
    41
  ./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
    42
  ./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
    43
  ./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
    44
  $ 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
    45
  ./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
    46
  ./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
    47
  ./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
    48
  ./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
    49
  $ 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
    50
  ./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
    51
  ./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
    52
  ./Library/Python/2.7/site-packages/mercurial/localrepo.pyo	100644	0/0
32472
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32471
diff changeset
    53
  $ egrep 'bin/' boms.txt | cut -d '	' -f 1,2,3
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32471
diff changeset
    54
  ./usr/local/bin/chg	100755	0/0
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    55
  ./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
    56
29535
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
    57
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
    58
  $ 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
    59
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
    60
  $ 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
    61
  #!/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
    62
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    63
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
    64
including merge-tool configurations.