source: protocols/skype/HACKING @ 71abe93

Last change on this file since 71abe93 was 3e23850, checked in by Miklos Vajna <vmiklos@…>, at 2013-02-11T12:56:03Z

skype: add ATTACH_GDB env flag, extend hacking instructions with info on pexpect/gdb

  • Property mode set to 100644
File size: 2.2 KB
Line 
1== Tabs
2
3I use the following tabs during the development:
4
51) bitlbee-skype:
6
7vim, make, etc.
8
92) bitlbee:
10
11gdb --args ./bitlbee -v -n -D
12run
13
143) skyped:
15
16python skyped.py -n -d
17
184) irssi
19
20
21== Tests
22
23The plugin is tested with a mocked IRC client and a mocked skyped.
24
25=== Requirements
26
27Python pexpect module is required to run the tests.
28
29To run tests with bitlbee built in a development tree and not (the one)
30installed in the system (e.g. /usr), make sure to specify --plugindir= option to
31./configure script during the build process:
32
33bitlbee% ./configure --skype=1 --plugindir="$(realpath .)"
34
35Otherwise bitlbee will try to load skype.so (among other things) from /usr/lib,
36which is probably not what you want to test, or produce "Unknown protocol"
37error.
38
39=== Running
40
41Tests can be run by running test.py script in this ("protocols/skype")
42directory.
43
44For more control over how/which tests are being run from there, use "python -m
45unittest" command:
46
47bitlbee/protocols/skype% python -m unittest test
48bitlbee/protocols/skype% python -m unittest -f test
49bitlbee/protocols/skype% python -m unittest test.Test.testMsg
50
51If bitlbee crashes during tests with SIGSEGV (segmentation fault), it's likely
52that there is some problem with skype.c plugin.
53To get a backtrace of such crash, use:
54
55bitlbee/protocols/skype% ATTACH_GDB=true python -m unittest test.Test.testMsg
56
57Example shows running "testMsg" test with gdb attached to bitlbee, which will
58produce full backtrace in "t/gdb-<pid>.log" files (see pid in pexpect error
59output of the test).
60
61=== Adding new tests
62
63To add a new test, the following steps are necessary:
64
651) Add a new -skyped.mock file: just do the test manually, copy&paste the
66skyped output and clean it up, so Alice talks to Bob.  You can test the created
67mock file by starting skyped with the -m option, and testing it from an IRC
68client manually.
69
702) Add a new -bitlbee.mock file: do the test manually from irssi, and use:
71
72/connect -rawlog rawlog localhost
73
74Then clean up the rawlog: the input lines are parsed as matching patterns, so
75boring prefix/suffix text can be left out, non-interesting lines can be
76deleted. The output lines still have to be strict IRC commands, as usual.
77
783) Add the new test to test.py and run it!
79
80// vim: ft=asciidoc
Note: See TracBrowser for help on using the repository browser.