sapling/tests/test-fb-hgext-sigtrace.t
Kostia Balytskyi e75b9fc1b1 fb-hgext: move most of hgext3rd and related tests to core
Summary:
This commit moves most of the stuff in hgext3rd and related tests to
hg-crew/hgext and hg-crew/test respectively.

The things that are not moved are the ones which require some more complex
imports.


Depends on D6675309

Test Plan: - tests are failing at this commit, fixes are in the following commits

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675329
2018-01-09 03:03:59 -08:00

48 lines
1.1 KiB
Perl

$ PYTHONPATH=$TESTDIR/../:$PYTHONPATH
$ export PYTHONPATH
$ cat >> $TESTTMP/signal.py << EOF
> from mercurial import registrar
> import os, signal
> cmdtable = {}
> command = registrar.command(cmdtable)
> @command('signal', norepo=True)
> def signalcommand(ui, *pats, **kwds):
> os.kill(os.getpid(), getattr(signal, 'SIG' + pats[0]))
> EOF
$ cat >> $HGRCPATH << EOF
> [extensions]
> sigtrace=$TESTDIR/../hgext3rd/sigtrace.py
> signal=$TESTTMP/signal.py
> [sigtrace]
> pathformat=$TESTTMP/dump-%(pid)s-%(time)s.log
> EOF
Test the default SIGUSR1 signal
$ hg signal USR1
$ ls $TESTTMP/dump-*.log
$TESTTMP/dump-*-*.log (glob)
$ grep Thread $TESTTMP/dump-*.log | head -n 1
Thread *: (glob)
$ rm $TESTTMP/dump-*.log
Test the signal config option
$ echo 'signal=USR2' >> $HGRCPATH
$ hg signal USR2
$ ls $TESTTMP/dump-*.log
$TESTTMP/dump-*-*.log (glob)
$ grep Thread $TESTTMP/dump-*.log | head -n 1
Thread *: (glob)
$ rm $TESTTMP/dump-*.log
$ echo 'signal=INVALIDSIGNAL' >> $HGRCPATH
$ hg signal USR1 || false
* (glob)
[1]
$ ls $TESTTMP/dump-*.log || false
ls: * (glob)
[1]