pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] make syntax-check


From: Zac Brown
Subject: Re: [pdf-devel] make syntax-check
Date: Wed, 03 Sep 2008 15:07:29 -0400
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

address@hidden wrote:
Hi Zac.

    > > If you write a suitable python script to do that in bazaar please send
    > > it here and I will put it in prmgt/
> > > > I'll see what I can do. >
   Hey guys, I just wrote and tested a small hook, it works ok for me.

Nice, many thanks.

   Some notes first,

   1. In order to place the script in the "prmgt" directory we also need to set
      "BZR_PLUGIN_PATH=./prmgt" (you can test it doing 'bzr hooks')

Ok. The user may want to do this or, alternatively, install the plugin
in her ~/.bazaar/plugins directory.

   2. The commit command must be run from the projects root
      directory. (otherwise bzr will ignore our hook, it seems to be
      an internal issue regarding bzr)

Maybe you can fix it by using an absolute path for BZR_PLUGIN_PATH?

   branch.Branch.hooks.install_named_hook('post_commit', post_commit_hook,
                                    'Patch safety scripts hook')

This is a post-commit hook... that means that the commit would be done
in any case, isnt it?

Since it is easy to undo a commit using bazaar this hook may be still
useful. Can you please write down proper headers in the script and
write down a note in the hackers guide about how to use it? Then I
will install it in the trunk.

   The output is correct, 'make check' is failing due to,

   base/text/pdf-text-cmp.c:283:F:pdf_text_cmp:pdf_text_cmp_006:0: Failure
   'pdf_text_init() != PDF_OK' occured

Hm. I see that almost all of the text tests are failing
(http://www.gnupdf.org/Lib:Unit_Testing_Report#Test_Suite_text).
Aleks, can you take a look at this? The error conditions are all of
the form "pdf_text_init() != PDF_OK". Maybe it is related with
locales.

As a note, every test passes for me. I'm also using en_US.UTF-8 so that may be something.

Jose, I've attached a pre-commit hook that will fail if any tests fail, based of Gerel's work.

-Zac
from bzrlib import branch
from bzrlib import errors
import os

script_cmds = ['make syntax-check', 'make check']

def pre_commit_hook(local, master, old_revno, old_revid, future_revno, 
future_revid, tree_delta, future_tree):
    success, fails = ([],[])
    for c in script_cmds:
        if (os.system(c) != 0):
            fails.append(c)
        else:
            success.append(c)
    for s in success:
        print ">>> " + s + ": succeeded."
    for f in fails:
        print ">>> " + f + ": failed."
        raise errors.BzrError("Pre-commit checks failed.")

branch.Branch.hooks.install_named_hook('pre_commit', pre_commit_hook, 'Patch 
safety scripts hook')

reply via email to

[Prev in Thread] Current Thread [Next in Thread]