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 14:44:13 -0400
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

address@hidden wrote:
 > Hey guys, I just wrote and tested a small hook, it works ok for me.

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')

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)


-- snip --
I just run a commit test and here are the last 4 output lines:
##
make[1]: Leaving directory `/home/gerel/PROJECTS/libgnupdf/local/torture'
make: *** [check-recursive] Error 1
make syntax-check: succeeded.
make check: failed.
###

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


cheers

-gerel

Hmmm thats not failing for me on any systems. Have you modified something on 
yours?

My other note is that you should make it a pre-commit hook. I've modified yours (very simply :-P) and made it pre-commit. We don't want a commit to succeed if the tests fail, otherwise its wasted commits.

see below:

-- begin pre_commit_checks.py --

from bzrlib import branch
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."

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

-- end pre_commit_checks.py --

-Zac




reply via email to

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