Mercurial > hg
view tests/test-log-exthook.t @ 35670:2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
I'd like to get the majority of our C code covered by automated fuzz
testing. I've started with bdiff because it was already decoupled from
libpython and therefore was fairly quick to produce a working
fuzzer. The code here is a little odd because I've been having trouble
convincing libfuzzer to define a main and I threw in the towel.
This code will also work with github.com/google/oss-fuzz, and once it
lands in our main repo I intend to enable automated fuzzing in
oss-fuzz with reports going to our security alias.
Differential Revision: https://phab.mercurial-scm.org/D1875
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 17 Jan 2018 15:47:38 -0500 |
parents | bfafd189edd9 |
children | c8e2d6ed1f9e |
line wrap: on
line source
Test hg log changeset printer external hook ------------------------------------------- $ cat > $TESTTMP/logexthook.py <<EOF > from __future__ import absolute_import > from mercurial import ( > cmdutil, > commands, > repair, > ) > def rot13description(self, ctx): > summary = "summary".encode('rot13') > description = ctx.description().strip().splitlines()[0].encode('rot13') > self.ui.write("%s: %s\n" % (summary, description)) > def reposetup(ui, repo): > cmdutil.changeset_printer._exthook = rot13description > EOF Prepare the repository $ hg init empty $ cd empty $ touch ROOT $ hg commit -A -m "Root" ROOT $ touch a b c $ hg commit -A -m "Add A, B, C" a b c Check the log $ hg log --config extensions.t=$TESTTMP/logexthook.py changeset: 1:70fc82b23320 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 fhzznel: Nqq N, O, P summary: Add A, B, C changeset: 0:b00443a54871 user: test date: Thu Jan 01 00:00:00 1970 +0000 fhzznel: Ebbg summary: Root Check that exthook is working with graph log too $ hg log -G --config extensions.t=$TESTTMP/logexthook.py @ changeset: 1:70fc82b23320 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | fhzznel: Nqq N, O, P | summary: Add A, B, C | o changeset: 0:b00443a54871 user: test date: Thu Jan 01 00:00:00 1970 +0000 fhzznel: Ebbg summary: Root