diff options
author | Andreas Schneider <mail@cynapses.org> | 2010-03-02 13:47:14 +0100 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2010-03-02 13:54:14 +0100 |
commit | 464176d5111676161d809ac3f5aeaa0f9fb2ff5b (patch) | |
tree | f9ca2912faa6b68e23603438fc5f13ad19702789 /tests/torture.h | |
parent | e8a1d135e21721426851312dc2a9180e5c38273f (diff) | |
download | libssh-464176d5111676161d809ac3f5aeaa0f9fb2ff5b.tar.gz libssh-464176d5111676161d809ac3f5aeaa0f9fb2ff5b.tar.xz libssh-464176d5111676161d809ac3f5aeaa0f9fb2ff5b.zip |
Added unit testing support using check.
Diffstat (limited to 'tests/torture.h')
-rw-r--r-- | tests/torture.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/torture.h b/tests/torture.h new file mode 100644 index 00000000..542b2757 --- /dev/null +++ b/tests/torture.h @@ -0,0 +1,34 @@ +#ifndef _TORTURE_H +#define _TORTURE_H + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <check.h> + +/* Used by main to communicate with parse_opt. */ +struct argument_s { + char *args[2]; + int nofork; +}; + +void torture_cmdline_parse(int argc, char **argv, struct argument_s *arguments); + +/* create_case() with timeout of 30seconds (default) */ +void torture_create_case(Suite *s, const char *name, TFun function); + +/* create_case() with timeout of 30seconds (default) and fixture */ +void torture_create_case_fixture(Suite *s, const char *name, TFun function, + void (*setup)(void), void (*teardown)(void)); + +/* + * create_case_timeout() allow to specific a specific timeout - intended for + * breaking testcases which needs longer then 30seconds (default) + */ +void torture_create_case_timeout(Suite *s, const char *name, TFun function, + int timeout); + +#endif /* _TORTURE_H */ |