summaryrefslogtreecommitdiff
path: root/test/birdtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/birdtest.c')
-rw-r--r--test/birdtest.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/birdtest.c b/test/birdtest.c
index 745118d0..10d6d6de 100644
--- a/test/birdtest.c
+++ b/test/birdtest.c
@@ -119,6 +119,8 @@ bt_init(int argc, char *argv[])
clock_gettime(CLOCK_MONOTONIC, &bt_begin);
bt_suite_case_begin = bt_suite_begin = bt_begin;
+ resource_init();
+
return;
usage:
@@ -172,6 +174,8 @@ int bt_run_test_fn(int (*fn)(const void *), const void *fn_arg, int timeout)
if (!bt_suite_result)
result = 0;
+ tmp_flush();
+
return result;
}
@@ -309,6 +313,12 @@ bt_log_suite_case_result(int result, const char *fmt, ...)
}
}
+void
+bt_reset_suite_case_timer(void)
+{
+ clock_gettime(CLOCK_MONOTONIC, &bt_suite_case_begin);
+}
+
int
bt_test_suite_base(int (*fn)(const void *), const char *id, const void *fn_arg, int forked, int timeout, const char *dsc, ...)
{
@@ -501,6 +511,15 @@ bt_fmt_ipa(char *buf, size_t size, const void *data)
bsnprintf(buf, size, "(null)");
}
+void
+bt_format_net(char *buf, size_t size, const void *data)
+{
+ if (data)
+ bsnprintf(buf, size, "%N", (const net_addr *) data);
+ else
+ bsnprintf(buf, size, "(null)");
+}
+
int
bt_is_char(byte c)
{