1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 04:16:38 +02:00

tests: add command /testapi.xx in test script, display elapsed time in scripting API tests

This commit is contained in:
Sébastien Helleu
2017-10-10 19:43:47 +02:00
parent 358297ba8f
commit 81a447dbb0
2 changed files with 29 additions and 6 deletions
+9 -4
View File
@@ -117,10 +117,7 @@ def test_lists():
weechat.list_free(ptr_list)
def weechat_init():
"""Main function."""
weechat.register('SCRIPT_NAME', 'SCRIPT_AUTHOR', 'SCRIPT_VERSION',
'SCRIPT_LICENSE', 'SCRIPT_DESCRIPTION', '', '')
def cmd_test_cb(data, buf, args):
weechat.prnt('', '>>>')
weechat.prnt('', '>>> ------------------------------')
weechat.prnt('', '>>> Testing ' + 'SCRIPT_LANGUAGE' + ' API')
@@ -129,3 +126,11 @@ def weechat_init():
test_strings()
test_lists()
weechat.prnt('', ' > TESTS END')
return weechat.WEECHAT_RC_OK
def weechat_init():
"""Main function."""
weechat.register('SCRIPT_NAME', 'SCRIPT_AUTHOR', 'SCRIPT_VERSION',
'SCRIPT_LICENSE', 'SCRIPT_DESCRIPTION', '', '')
weechat.hook_command('SCRIPT_NAME', '', '', '', '', 'cmd_test_cb', '')