diff options
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | Cakefile | 2 | ||||
| -rwxr-xr-x | git_hooks/pre-commit | 18 |
3 files changed, 24 insertions, 0 deletions
@@ -1,3 +1,7 @@ +*.un~ +*.swo +*.swp +*.crx background_scripts/completion.js background_scripts/commands.js background_scripts/settings.js @@ -47,3 +47,5 @@ task "test", "run all unit tests", -> test_files = test_files.map((filename) -> "tests/" + filename) test_files.forEach (file) -> require "./" + file Tests.run() + if Tests.testsFailed > 0 + process.exit 1 diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit new file mode 100755 index 00000000..4c618746 --- /dev/null +++ b/git_hooks/pre-commit @@ -0,0 +1,18 @@ +#!/bin/sh + +TDIR=`mktemp -d -t vimium` + +if [ $? -ne 0 ] +then + exit 1 +fi + +git checkout-index --prefix=$TDIR/ -af + +cake test + +TEST_RESULT=$? + +rm -rf $TDIR + +exit $TEST_RESULT |
