From 65a5d154b052c9ff35a79eaf8e3405522c8737cc Mon Sep 17 00:00:00 2001 From: Mike Kazantsev Date: Mon, 11 Feb 2013 13:56:03 +0100 Subject: skype: mention --plugindir quirk in HACKING As skype support always gets built as plugin, option is required for running tests without installing plugin to the system. --- protocols/skype/HACKING | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'protocols/skype/HACKING') diff --git a/protocols/skype/HACKING b/protocols/skype/HACKING index a6ff8290..edca0a45 100644 --- a/protocols/skype/HACKING +++ b/protocols/skype/HACKING @@ -19,8 +19,19 @@ python skyped.py -n -d == Tests -The plugin is tested with a mocked IRC client and a mocked skyped. To add a new -test, the following steps are necessary: +The plugin is tested with a mocked IRC client and a mocked skyped. + +To run tests with bitlbee built in a development tree and not (the one) +installed in the system (e.g. /usr), make sure to specify --plugindir= option to +./configure script during the build process: + +bitlbee% ./configure --skype=1 --plugindir="$(realpath .)" + +Otherwise bitlbee will try to load skype.so (among other things) from /usr/lib, +which is probably not what you want to test, or produce "Unknown protocol" +error. + +To add a new test, the following steps are necessary: 1) Add a new -skyped.mock file: just do the test manually, copy&paste the skyped output and clean it up, so Alice talks to Bob. You can test the created -- cgit v1.2.3 From 3e238504209e998064f0906c9edfced9713ba94d Mon Sep 17 00:00:00 2001 From: Mike Kazantsev Date: Mon, 11 Feb 2013 13:56:03 +0100 Subject: skype: add ATTACH_GDB env flag, extend hacking instructions with info on pexpect/gdb --- protocols/skype/HACKING | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'protocols/skype/HACKING') diff --git a/protocols/skype/HACKING b/protocols/skype/HACKING index edca0a45..935856a7 100644 --- a/protocols/skype/HACKING +++ b/protocols/skype/HACKING @@ -17,10 +17,15 @@ python skyped.py -n -d 4) irssi + == Tests The plugin is tested with a mocked IRC client and a mocked skyped. +=== Requirements + +Python pexpect module is required to run the tests. + To run tests with bitlbee built in a development tree and not (the one) installed in the system (e.g. /usr), make sure to specify --plugindir= option to ./configure script during the build process: @@ -31,6 +36,30 @@ Otherwise bitlbee will try to load skype.so (among other things) from /usr/lib, which is probably not what you want to test, or produce "Unknown protocol" error. +=== Running + +Tests can be run by running test.py script in this ("protocols/skype") +directory. + +For more control over how/which tests are being run from there, use "python -m +unittest" command: + +bitlbee/protocols/skype% python -m unittest test +bitlbee/protocols/skype% python -m unittest -f test +bitlbee/protocols/skype% python -m unittest test.Test.testMsg + +If bitlbee crashes during tests with SIGSEGV (segmentation fault), it's likely +that there is some problem with skype.c plugin. +To get a backtrace of such crash, use: + +bitlbee/protocols/skype% ATTACH_GDB=true python -m unittest test.Test.testMsg + +Example shows running "testMsg" test with gdb attached to bitlbee, which will +produce full backtrace in "t/gdb-.log" files (see pid in pexpect error +output of the test). + +=== Adding new tests + To add a new test, the following steps are necessary: 1) Add a new -skyped.mock file: just do the test manually, copy&paste the -- cgit v1.2.3