-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Saru is a minimal testing framework.
Its written in python and designed to support tests written in whatever language you choose. Adding new languages
is usually only a little bit of work.
Saru is simple to work with as it uses the unix philosophy of many small programs. Each test is a progam. (Not strictly true but close enough for now). If the program returns 0 it has passed, 1 if it fails. Extra output is used for reporting what has gone wrong.
So the simplest saru C++ test looks like this.
// SARU : Tag simple
int main()
{
return 0;
}
the simplest php test might look like this
<?php
// SARU : Tag simple
exit(0);
?>
the simplest python test might look like this
#!/bin/python
# SARU : Tag simple
import sys
sys.exit(0)
etc.
The comment tags are used to allow saru to distinguish between files that contain saru tests and those that may form part of a supprt library, such as a library of mock ojects or helper routines.
Note that these are the simplest examples of tests.
More complex files can contain multiple tests and have error reporting.
There is a helper library to make writing tests in C++ easier.
Helper libraries are under development for python and php.
You can also get information from the wiki pages of one of the initial developers