Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG81ca0fd348e3: tests: test failure reporting in blackbox code
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | tests/test-blackbox.t (31 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | May 15 2018, 12:57 PM |
Status | Author | Revision | |
---|---|---|---|
Abandoned | martinvonz | ||
Closed | martinvonz |
setup | setup | ||||
$ cat > myextension.py <<EOF | |||||
> from mercurial import error, registrar | |||||
> cmdtable = {} | |||||
> command = registrar.command(cmdtable) | |||||
> @command('crash', [], b'hg crash') | |||||
> def crash(ui, *args, **kwargs): | |||||
> raise Exception("oops") | |||||
> EOF | |||||
$ abspath=`pwd`/myextension.py | |||||
$ cat >> $HGRCPATH <<EOF | $ cat >> $HGRCPATH <<EOF | ||||
> [extensions] | > [extensions] | ||||
> blackbox= | > blackbox= | ||||
> mock=$TESTDIR/mockblackbox.py | > mock=$TESTDIR/mockblackbox.py | ||||
> mq= | > mq= | ||||
> myextension=$TESTTMP/myextension.py | |||||
> [alias] | > [alias] | ||||
> confuse = log --limit 3 | > confuse = log --limit 3 | ||||
> so-confusing = confuse --style compact | > so-confusing = confuse --style compact | ||||
> EOF | > EOF | ||||
$ hg init blackboxtest | $ hg init blackboxtest | ||||
$ cd blackboxtest | $ cd blackboxtest | ||||
command, exit codes, and duration | command, exit codes, and duration | ||||
$ echo a > a | $ echo a > a | ||||
$ hg add a | $ hg add a | ||||
$ hg blackbox --config blackbox.dirty=True | $ hg blackbox --config blackbox.dirty=True | ||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob) | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob) | ||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a | ||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) | ||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob) | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob) | ||||
failure exit code | |||||
$ rm ./.hg/blackbox.log | |||||
$ hg add non-existent | |||||
non-existent: $ENOENT$ | |||||
[1] | |||||
$ hg blackbox | |||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent | |||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent exited 1 after * seconds (glob) | |||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox | |||||
unhandled exception | |||||
$ rm ./.hg/blackbox.log | |||||
$ hg crash 2> /dev/null | |||||
[1] | |||||
$ hg blackbox -l 2 | |||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> crash exited -1 after * seconds (glob) | |||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox -l 2 | |||||
alias expansion is logged | alias expansion is logged | ||||
$ rm ./.hg/blackbox.log | $ rm ./.hg/blackbox.log | ||||
$ hg confuse | $ hg confuse | ||||
$ hg blackbox | $ hg blackbox | ||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse | ||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3' | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3' | ||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob) | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob) | ||||
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox |