Latest commit to the master branch
The test daemon watches the content of files in a directory and if any of them changes (the content is edited), it runs the tests.
Put the tdaemon somewhere where it's executable.
Simply run this:
$ python /path/to/tdaemon.py
The daemon starts watching the current directory and subdirectories. As soon as one file changes, the daemon runs nosetests and you may watch the result.
If you want to run the daemon from another directory than your current directory, just run:
$ tdaemon.py /path/to/your/project
For example, try out py.test:
$ tdaemon.py --test-program=py
Nosetests is the default test program, but you may use others.
The available test programs are:
nose or nosetests) django (keyword is django) py.test (keyword is py) symfony (keyword is symfony) jelix (keyword is jelix) phpunit (keyword is phpunit)Bear in mind that if you want to use one of these program, you must install them on your system.
Note : When you're using django, the path to the project must be the path where manage.py lives.
Most test programs allow you to test using specifig arguments, to test a small part of your project, or using a specific setting. If you want to append specific arguments to your command line, use the --custom-args parameter like this::
$ tdaemon.py --custom-args="myapp.MyTestClass" --test-program=django
The above command will execute the following command in the current directory:
$ ./manage.py myapp.MyTestClass
Please refer to the test program manual / documentation to find out which additional argument you may use here.
WARNING: Please note that every time you're going to use this option, it will require your confirmation. You are being warned that any command that would break your system, erase some important data, etc. is YOUR PLAIN FAULT!. Not mine. So BE CAREFUL. Please.
The tdaemon first checks the total filesize you want to scan. If the total file size exceeds his quota (which is 25MB by default), the program asks you if you still want to go on with this. You may be informed that scanning large directories may take some time, and thus alter the daemon performances.
You can change this quota by using the --size-max argument. For example:
$ tdaemon --size-max=100
With this argument, the programm will only ask for your permission to proceed with a total archive of more than 100MB.
[ ] Extend the test utilities to other languages
[ ] Add an "ignore" option to ignore other files (logs, sqlite database,
image files, etc)
[ ] Check other pythonic dependencies (django, py.test). Won't be possible
for non-python test-programs, though
[X] implements py.test, if possible
[X] Fixing bug: when a file vanished, the program fails.
[X] I remember I made the first bits of the code after reading an article...
[X] Find the link and name of the original author
[X] add appropriate credits
[X] Bugfix: When doing (e.g.) hg commit, it opens temporary files that are
detected as "changed", and the daemon starts tests. It should be ignored
(ref. ignore-directories)
[X] Feature: If the scanned directory size if larger than the option limit,
asking for the user to accept processing or not. Default option limit is 25MB
[X] OBSOLETE: Add the possibility to run a custom command.
(eg. ``python manage.py test myapp.MyTest``)
[X] Erase the custom command option. Too dangerous
[X] Check the only default dependency: ``nosetests``.
[X] Add an "custom argument" option. The user may want to run specific
commands, but the only way to do so is to send arguments rather than the
whole external command. Tests must pass, though (no `&`, for example)
![[image]](http://mowser.com/img?url=https%3A%2F%2Fa248.e.akamai.net%2Fassets.github.com%2Fimages%2Fmodules%2Fajax%2Fbig_spinner_336699.gif%3F1252203928)
Headers
# This is an <h1> tag ## This is an <h2> tag ###### This is an <h6> tag
Text styles
*This text will be italic* _This will also be italic_ **This text will be bold** __This will also be bold__ *You **can** combine them*
Unordered
* Item 1 * Item 2 * Item 2a * Item 2b
Ordered
1. Item 1 2. Item 2 3. Item 3 * Item 3a * Item 3b
Images
 Format: 
Links
http://github.com - automatic! [GitHub](http://github.com)
Blockquotes
As Kanye West said: > We're living the future so > the present is our past.
Syntax highlighting with GFM
```javascript
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'})
}
}
```
Or, indent your code 4 spaces
Here is a Python code example
without syntax highlighting:
def foo:
if not bar:
return true
Inline code for comments
I think you should use an `<addr>` element here instead.
You are viewing a mobilized version of this site...
View original page here