tests/test-mac-packages.t
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Fri, 26 Apr 2024 19:10:35 +0100
changeset 51626 865efc020c33
parent 50725 7e5be4a7cda7
permissions -rw-r--r--
dirstate: remove the python-side whitelist of allowed matchers This whitelist is too permissive because it allows matchers that contain disallowed ones deep inside, for example through `intersectionmatcher`. It is also too restrictive because it doesn't pass through some of the matchers we support, such as `patternmatcher`. It's also unnecessary because unsupported matchers raise `FallbackError` and we fall back anyway. Making this change makes more of the tests use rust code path, and therefore subtly change behavior. For example, rust status in largefiles repos seems to have strange behavior.
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"
33204
ddd65b4f3ae6 tests: alias syshg and syshgenv so they can be switched conditionally
Yuya Nishihara <yuya@tcha.org>
parents: 33116
diff changeset
     4
  $ testrepohgenv
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"/..
33594
283a7da602ae osx: new script for generating OS X package versions
Augie Fackler <augie@google.com>
parents: 33593
diff changeset
    12
  $ contrib/genosxversion.py --selftest ignoredarg
31610
6dc8caccef8a osx: use more paranoid quoting in test
Augie Fackler <augie@google.com>
parents: 31609
diff changeset
    13
  $ make osx > "$OUTPUTDIR/build.log" 2>&1
6dc8caccef8a osx: use more paranoid quoting in test
Augie Fackler <augie@google.com>
parents: 31609
diff changeset
    14
  $ cd "$OUTPUTDIR"
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    15
  $ ls -d *.pkg
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    16
  Mercurial-*-macosx10.*.pkg (glob)
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    17
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    18
  $ xar -xf Mercurial*.pkg
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    19
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    20
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
    21
  $ 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
    22
32575
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    23
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
    24
.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
    25
  $ grep DS_S boms.txt
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    26
  [1]
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31610
diff changeset
    27
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    28
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
    29
  $ 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
    30
  ./Library/Python/2.7/site-packages/mercurial/cext/bdiff.so	100755	0/0
33593
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    31
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.py	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    32
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.pyc	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    33
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.pyo	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    34
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.py	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    35
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.pyc	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    36
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.pyo	100644	0/0
29027
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/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
    38
  ./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
    39
  ./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
    40
  $ 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
    41
  ./usr/local/share/zsh/site-functions/_hg	100644	0/0
48988
8d7eaff92f9c completion: install completers to conventional locations
Matthew Martin <phy1729@gmail.com>
parents: 33594
diff changeset
    42
  $ grep bash-completion/completions/hg boms.txt | cut -d '	' -f 1,2,3
8d7eaff92f9c completion: install completers to conventional locations
Matthew Martin <phy1729@gmail.com>
parents: 33594
diff changeset
    43
  ./usr/local/share/bash-completion-completions/hg	100644	0/0
50725
7e5be4a7cda7 tests: use grep -E instead of obsolescent egrep
Mads Kiilerich <mads@kiilerich.com>
parents: 48988
diff changeset
    44
  $ grep -E 'man[15]' boms.txt | cut -d '	' -f 1,2,3
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    45
  ./usr/local/share/man/man1	40755	0/0
32472
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32471
diff changeset
    46
  ./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
    47
  ./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
    48
  ./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
    49
  ./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
    50
  ./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
    51
  $ 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
    52
  ./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
    53
  ./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
    54
  ./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
    55
  ./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
    56
  $ 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
    57
  ./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
    58
  ./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
    59
  ./Library/Python/2.7/site-packages/mercurial/localrepo.pyo	100644	0/0
50725
7e5be4a7cda7 tests: use grep -E instead of obsolescent egrep
Mads Kiilerich <mads@kiilerich.com>
parents: 48988
diff changeset
    60
  $ grep -E 'bin/' boms.txt | cut -d '	' -f 1,2,3
32472
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32471
diff changeset
    61
  ./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
    62
  ./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
    63
29535
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
    64
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
    65
  $ 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
    66
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
    67
  $ 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
    68
  #!/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
    69
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    70
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
    71
including merge-tool configurations.