rodrigorm / cake_autotest
- Source
- Commits
- Network (3)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
252164b
README
Installation
===========
To be able to use this package anywhere on your computer, move the files to the following location:
...
app
someotherapp
cake
vendors
notify.php
shells
autotest.php
repo.php
For cake 1.3+ the process is even simpler:
app
someotherapp
cake
plugins <- new folder in 1.3
autotest
vendors
notify.php
shells
autotest.php
repo.php
vendors
cd plugins
git clone git://github.com/rodrigorm/cake_autotest.git autotest
Notify - send status messages
Autotest - monitor a folder for changes, and call the repo shell for any changed files
Repo - syntax checks and test-case running by file name
Using as a git hook
==================
To use as a pre-commit hook, create/edit .git/hooks/pre-commit with the following contents:
>>>
#!/bin/sh
cake repo checkFiles pre-commit -q -noclear
<<<
Ensure that the shebang matches the path to your desired shell. To find your shell type "which sh/bash/csh"
and edit appropriately.
Make the file executable and the repo shell will then be called each time you commit.
you can test your git hook by typing:
$ . .git/hooks/pre-commit
Using as an svn hook
====================
*Use as an svn hook is still a WIP*
To use as a pre-commit hook for svn create/edit hooks/pre-commit on the repository with the following contents:
>>>
#!/bin/sh
TERM=linux
export TERM
CAKE=/cake/is/herex/console/cake
$CAKE repo checkFiles pre-commit -q -repo $1 -txn $2 >&2
<<<
Notes:
on a Windows system, you should name the hook 'pre-commit.bat' or 'pre-commit.exe'
You can nominate a config file (on the svn server) using the config switch:
cake repo ... -config /use/this/config/file
Users can override the pre-commit hook by including @noverify at the end of any line in their
commit message.
The svn repo can disable the @noverify flag by setting $config['disableNoverify'] in the config
file
Using realtime
==============
To use automatically whenever you edit a file in your project, run "cake autotest" from the folder
you want to be monitored. Using with screen may be convenient ("screen cake autotest") as you can
then close the terminal and the process will continue to run.
