diff options
Diffstat (limited to 'test/test-lib.h')
-rw-r--r-- | test/test-lib.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test-lib.h b/test/test-lib.h index 54c1472..de9c10f 100644 --- a/test/test-lib.h +++ b/test/test-lib.h @@ -62,4 +62,19 @@ do { \ #define BUFSIZE 1000 +#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 |