diff options
| author | Franck Cuny <franckcuny@gmail.com> | 2016-08-04 11:12:37 -0700 |
|---|---|---|
| committer | Franck Cuny <franckcuny@gmail.com> | 2016-08-04 11:12:37 -0700 |
| commit | 2d2a43f200b88627253f2906fbae87cef7c1e8ce (patch) | |
| tree | c65377350d12bd1e62e0bdd58458c1044541c27b /posts/2009-04-14-git-and-prove.org | |
| parent | Use Bullet list for the index. (diff) | |
| download | lumberjaph-2d2a43f200b88627253f2906fbae87cef7c1e8ce.tar.gz | |
Mass convert all posts from markdown to org.
Diffstat (limited to '')
| -rw-r--r-- | posts/2009-04-14-git-and-prove.org | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/posts/2009-04-14-git-and-prove.org b/posts/2009-04-14-git-and-prove.org new file mode 100644 index 0000000..1048f56 --- /dev/null +++ b/posts/2009-04-14-git-and-prove.org @@ -0,0 +1,27 @@ +A little trick to force you to run your tests before a commit: + +in a repositorie, create the following file *.git/hooks/pre-commit* with +this content: + +#+BEGIN_SRC sh + #!/bin/sh + if [ -d t ]; then + res=`prove t` + if [ $? -gt 0 ]; then + echo "tests fails" + exit 1 + fi + fi + if [ -d xt ]; then + res=`prove xt` + if [ $? -gt 0 ]; then + echo "tests fails" + exit 1 + fi + fi +#+END_SRC + +and don't forget to chmod with +x. + +Now, when you will do your next commit, your test suit will be executed. +If the tests fails, the commit will be rejected. |
