summaryrefslogtreecommitdiffstats
path: root/test/test-args.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-args.h')
-rw-r--r--test/test-args.h31
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 */