Details
Details
- Reviewers
marmoute pulkit - Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
marmoute | |
pulkit |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | tests/run-tests.py (7 lines) | |||
M | tests/test-rhg.t (10 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
78353340e333 | 27f877dc9266 | Antoine Cezar | Jul 6 2020, 3:26 AM |
keeptmpdir=False, | keeptmpdir=False, | ||||
debug=False, | debug=False, | ||||
first=False, | first=False, | ||||
timeout=None, | timeout=None, | ||||
startport=None, | startport=None, | ||||
extraconfigopts=None, | extraconfigopts=None, | ||||
shell=None, | shell=None, | ||||
hgcommand=None, | hgcommand=None, | ||||
rhgcommand=None, | |||||
slowtimeout=None, | slowtimeout=None, | ||||
usechg=False, | usechg=False, | ||||
chgdebug=False, | chgdebug=False, | ||||
useipv6=False, | useipv6=False, | ||||
): | ): | ||||
"""Create a test from parameters. | """Create a test from parameters. | ||||
path is the full path to the file defining the test. | path is the full path to the file defining the test. | ||||
self._debug = debug | self._debug = debug | ||||
self._first = first | self._first = first | ||||
self._timeout = timeout | self._timeout = timeout | ||||
self._slowtimeout = slowtimeout | self._slowtimeout = slowtimeout | ||||
self._startport = startport | self._startport = startport | ||||
self._extraconfigopts = extraconfigopts or [] | self._extraconfigopts = extraconfigopts or [] | ||||
self._shell = _sys2bytes(shell) | self._shell = _sys2bytes(shell) | ||||
self._hgcommand = hgcommand or b'hg' | self._hgcommand = hgcommand or b'hg' | ||||
self._rhgcommand = rhgcommand or _sys2bytes( | |||||
os.path.abspath('./rust/target/release/rhg') | |||||
) | |||||
self._usechg = usechg | self._usechg = usechg | ||||
self._chgdebug = chgdebug | self._chgdebug = chgdebug | ||||
self._useipv6 = useipv6 | self._useipv6 = useipv6 | ||||
self._aborted = False | self._aborted = False | ||||
self._daemonpids = [] | self._daemonpids = [] | ||||
self._finished = None | self._finished = None | ||||
self._ret = None | self._ret = None | ||||
# We keep track of whether or not we're in a Python block so we | # We keep track of whether or not we're in a Python block so we | ||||
# can generate the surrounding doctest magic. | # can generate the surrounding doctest magic. | ||||
inpython = False | inpython = False | ||||
if self._debug: | if self._debug: | ||||
script.append(b'set -x\n') | script.append(b'set -x\n') | ||||
if self._hgcommand != b'hg': | if self._hgcommand != b'hg': | ||||
script.append(b'alias hg="%s"\n' % self._hgcommand) | script.append(b'alias hg="%s"\n' % self._hgcommand) | ||||
if self._rhgcommand != b'rhg': | |||||
script.append(b'alias rhg="%s"\n' % self._rhgcommand) | |||||
if os.getenv('MSYSTEM'): | if os.getenv('MSYSTEM'): | ||||
script.append(b'alias pwd="pwd -W"\n') | script.append(b'alias pwd="pwd -W"\n') | ||||
if hgcatapult and hgcatapult != os.devnull: | if hgcatapult and hgcatapult != os.devnull: | ||||
if PYTHON3: | if PYTHON3: | ||||
hgcatapult = hgcatapult.encode('utf8') | hgcatapult = hgcatapult.encode('utf8') | ||||
cataname = self.name.encode('utf8') | cataname = self.name.encode('utf8') | ||||
else: | else: | ||||
self._hgtmp = None | self._hgtmp = None | ||||
self._installdir = None | self._installdir = None | ||||
self._bindir = None | self._bindir = None | ||||
self._tmpbinddir = None | self._tmpbinddir = None | ||||
self._pythondir = None | self._pythondir = None | ||||
self._coveragefile = None | self._coveragefile = None | ||||
self._createdfiles = [] | self._createdfiles = [] | ||||
self._hgcommand = None | self._hgcommand = None | ||||
self._rhgcommand = None | |||||
self._hgpath = None | self._hgpath = None | ||||
self._portoffset = 0 | self._portoffset = 0 | ||||
self._ports = {} | self._ports = {} | ||||
def run(self, args, parser=None): | def run(self, args, parser=None): | ||||
"""Run the test suite.""" | """Run the test suite.""" | ||||
oldmask = os.umask(0o22) | oldmask = os.umask(0o22) | ||||
try: | try: |
#require rust | |||||
$ rhg() { | |||||
> if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then | |||||
> "$RUNTESTDIR/../rust/target/debug/rhg" "$@" | |||||
> else | |||||
> echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg." | |||||
> exit 80 | |||||
> fi | |||||
> } | |||||
$ rhg unimplemented-command | $ rhg unimplemented-command | ||||
[252] | [252] | ||||
$ rhg root | $ rhg root | ||||
abort: no repository found in '$TESTTMP' (.hg not found)! | abort: no repository found in '$TESTTMP' (.hg not found)! | ||||
[255] | [255] | ||||
$ hg init repository | $ hg init repository | ||||
$ cd repository | $ cd repository | ||||
$ rhg root | $ rhg root | ||||
$TESTTMP/repository | $TESTTMP/repository | ||||
$ rhg root > /dev/full | $ rhg root > /dev/full | ||||
abort: No space left on device (os error 28) | abort: No space left on device (os error 28) | ||||
[255] | [255] | ||||
$ rm -rf `pwd` | $ rm -rf `pwd` | ||||
$ rhg root | $ rhg root | ||||
abort: error getting current working directory: $ENOENT$ | abort: error getting current working directory: $ENOENT$ | ||||
[255] | [255] |