diff options
author | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-04-20 14:18:28 +0200 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-04-20 14:18:28 +0200 |
commit | c9d0018b9e527168292f8d40273a9e97223c0bc8 (patch) | |
tree | 899e1a2a97e98c74cd5d8830d0617c1b2729ba96 /test/test-args.h | |
parent | 73eaae45cbc65f3269c54273849d42a3719c357c (diff) | |
download | latrace-c9d0018b9e527168292f8d40273a9e97223c0bc8.tar.gz latrace-c9d0018b9e527168292f8d40273a9e97223c0bc8.tar.xz latrace-c9d0018b9e527168292f8d40273a9e97223c0bc8.zip |
adding automated test support
So far for x86 and x86_64 others are disabled.
From this time on, I'll try to force addition of automated
test for each fix/feature.. ;)
Diffstat (limited to 'test/test-args.h')
-rw-r--r-- | test/test-args.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test-args.h b/test/test-args.h new file mode 100644 index 0000000..d116382 --- /dev/null +++ b/test/test-args.h @@ -0,0 +1,31 @@ +#ifndef TEST_ARGS_H +#define TEST_ARGS_H + +#include <config.h> + +#include <test/test-lib.h> +#include <test/lib-test-args.h> + +#define CONFIG_CLEAR_ARGS(sh) \ +do { \ + config_clear(sh); \ + sh->args_enabled = 1; \ + sh->hide_tid = 1; \ +} while(0) + +#define LOCAL_TEST(data, cnt, test) \ +do { \ + char buf[BUFSIZE]; \ + int ret; \ + TEST_START(); \ + test; \ + TEST_STOP(); \ + ret = fout_read(sh, buf, BUFSIZE); \ + if (!ret) \ + return -1; \ + ret = re_test(buf, data, cnt); \ + if (RE_TEST_OK != ret) \ + FAILED("test %i, pattern '%s'\n", ret, data[ret].pat); \ +} while(0) + +#endif /* TEST_ARGS_H */ |