From cc98724d8f534a1a9dc8191de5ebf7dffb1baa0f Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 8 Mar 2016 21:00:33 +0000 Subject: [PATCH] Added timed callbacks to C and Python test plugins --- tests/python-test.py | 6 ++++++ tests/test-c-plugin/test-c-plugin.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/python-test.py b/tests/python-test.py index 4e8cb5c..e6d0cb5 100644 --- a/tests/python-test.py +++ b/tests/python-test.py @@ -142,6 +142,10 @@ def cmd_pythontest(arg1=None, arg2=None, arg3=None, arg4=None, arg5=None): else: prof.cons_bad_cmd_usage("/python-test") +def timed_callback(): + create_win() + prof.win_show(plugin_win, "timed -> timed_callback called") + def prof_init(version, status): prof.win_create(plugin_win, _handle_win_input) @@ -190,6 +194,8 @@ def prof_init(version, status): [ "debug", "info", "warning", "error" ] ) + prof.register_timed(timed_callback, 30) + def prof_on_start(): create_win() prof.win_show(plugin_win, "fired -> prof_on_start") diff --git a/tests/test-c-plugin/test-c-plugin.c b/tests/test-c-plugin/test-c-plugin.c index feafd14..f22b1d2 100644 --- a/tests/test-c-plugin/test-c-plugin.c +++ b/tests/test-c-plugin/test-c-plugin.c @@ -212,6 +212,13 @@ cmd_ctest(char **args) } } +void +timed_callback(void) +{ + create_win(); + prof_win_show(plugin_win, "timed -> timed_callback called"); +} + void prof_init(const char * const version, const char * const status) { @@ -264,6 +271,8 @@ prof_init(const char * const version, const char * const status) char *log_ac[] = { "debug", "info", "warning", "error", NULL }; prof_register_ac("/c-test log", log_ac); + + prof_register_timed(timed_callback, 30); } void