~ubuntu-branches/ubuntu/maverick/lire/maverick

« back to all changes in this revision

Viewing changes to doc/dev-manual.txt

  • Committer: Bazaar Package Importer
  • Author(s): Joost van Baal
  • Date: 2006-11-02 15:30:00 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20061102153000-ln3b4oxkq0xws8c1
Tags: 2:2.0.2-3
debian/po/cs.po: Updated Czech translation. Thanks Martin Šín
(Closes: #391544).

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
   http://www.gnu.org/copyleft/gpl.html or write to the Free Software
26
26
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
27
27
   Revision History
28
 
   Revision 2.0 $Date: 2004/09/04 11:38:27 $
29
 
   $Id: dev-manual.dbx,v 1.85 2004/09/04 11:38:27 vanbaal Exp $
 
28
   Revision 2.0.2 $Date: 2006/07/20 12:11:15 $
 
29
   $Id: dev-manual.dbx,v 1.87 2006/07/20 12:11:15 vanbaal Exp $
30
30
     _________________________________________________________________
31
31
 
32
32
   Table of Contents
201
201
              Shell Coding Standards
202
202
              Perl Coding Standards
203
203
 
204
 
        16. Making Lire Test-infected
 
204
        16. Making Lire "Test-infected"
205
205
 
206
206
              Unit Tests in Lire
207
207
 
209
209
 
210
210
              Writing Tests
211
211
              Running Tests
212
 
              Some Best Practices on Unit Testing
 
212
              Some "Best Practices" on Unit Testing
213
213
 
214
214
        17. Commit Policy
215
215
 
221
221
                    Accessing a Branch
222
222
                    Merging Branches on the Trunk
223
223
 
224
 
        18. Testing
 
224
        18. Testing and debugging
 
225
 
 
226
              Test before releasing
 
227
              Test-installations and test-runs
 
228
              Using the Perl debugger on Lire code
 
229
 
225
230
        19. Making a Release
226
231
 
227
232
              Setting version in NEWS file, checking ChangeLog
4617
4622
        Shell Coding Standards
4618
4623
        Perl Coding Standards
4619
4624
 
4620
 
   16. Making Lire Test-infected
 
4625
   16. Making Lire "Test-infected"
4621
4626
 
4622
4627
        Unit Tests in Lire
4623
4628
 
4625
4630
 
4626
4631
        Writing Tests
4627
4632
        Running Tests
4628
 
        Some Best Practices on Unit Testing
 
4633
        Some "Best Practices" on Unit Testing
4629
4634
 
4630
4635
   17. Commit Policy
4631
4636
 
4637
4642
              Accessing a Branch
4638
4643
              Merging Branches on the Trunk
4639
4644
 
4640
 
   18. Testing
 
4645
   18. Testing and debugging
 
4646
 
 
4647
        Test before releasing
 
4648
        Test-installations and test-runs
 
4649
        Using the Perl debugger on Lire code
 
4650
 
4641
4651
   19. Making a Release
4642
4652
 
4643
4653
        Setting version in NEWS file, checking ChangeLog
4830
4840
 
4831
4841
   Writing Tests
4832
4842
   Running Tests
4833
 
   Some Best Practices on Unit Testing
 
4843
   Some "Best Practices" on Unit Testing
4834
4844
 
4835
4845
   Soon after the release of Lire 1.2.1, unit tests were introduced in
4836
4846
   the source tree. Unit tests help development in several ways; the most
5031
5041
   the week's changes of the stable branch into the unstable branch by
5032
5042
   doing cvs update -j lire-stable-merged-20010715 -j lire-stable.
5033
5043
 
5034
 
Chapter 18. Testing
 
5044
Chapter 18. Testing and debugging
 
5045
 
 
5046
   Table of Contents
 
5047
 
 
5048
   Test before releasing
 
5049
   Test-installations and test-runs
 
5050
   Using the Perl debugger on Lire code
 
5051
 
 
5052
Test before releasing
5035
5053
 
5036
5054
   One week before release the software should be tested on all supported
5037
5055
   platforms. In between releases the system gets tested on various
5038
5056
   platforms on an ad hoc basis. When testing, use the to-be-released
5039
 
   tarball. Run make dist to generate such a tarball.
 
5057
   tarball. Run make distcheck to generate such a tarball.
5040
5058
 
5041
5059
   Especially when changes to the Lire core have been made, the "test"
5042
5060
   superservice can be handy, for easy setting up of tests of your code.
5043
5061
   See also the section on Unit Testing in this document.
5044
5062
 
 
5063
Test-installations and test-runs
 
5064
 
 
5065
   We give some hints on various ways to debug the Lire code. One can
 
5066
   make a test-install by extracting a tarball and running e.g.
 
5067
$  ./configure --prefix=$HOME/local && make && make install
 
5068
$ PATH=$HOME/local/bin:$PATH; export PATH
 
5069
$ MANPATH=$HOME/local/share/man; export MANPATH
 
5070
 
 
5071
 
 
5072
   One can do a test-run by executing:
 
5073
$ echo 'some bug-triggering log line' | lr_log2report -o xml <converter> > /tmp
 
5074
/report.xml
 
5075
$ lr_xml2report -o txt /tmp/report.xml > /tmp/report.txt
 
5076
$ $HOME/local/libexec/lire/convertors/combined2dlf < /tmp/combined.log > /tmp/d
 
5077
lf
 
5078
 
 
5079
 
 
5080
 
 
5081
Using the Perl debugger on Lire code
 
5082
 
 
5083
   Please use the perl debugger: investing some time to learn is pays
 
5084
   back really quick. Here's a very tiny howto.
 
5085
 
 
5086
   Start the debugger as e.g.
 
5087
perl -d `which lr_log2report` -o xml combined < tmp/log > /dev/null
 
5088
 
 
5089
 
 
5090
   After starting the debugger, run "v" and "c lineno" to make sure all
 
5091
   modules are loaded. Once that's done, you can fast-forward to a
 
5092
   relevant routine using e.g. "c
 
5093
   Lire::DlfAnalysers::ReferrerCategoriser::categorise". Now you can
 
5094
   inspect variables and evaluate expressions by running e.g.
 
5095
 DB<12> x $parsed_url->{'query'}
 
5096
 
 
5097
 
 
5098
   Also, be sure to try the commands "s" and "r". Just these 4 command
 
5099
   very likely are enough to get your job done. (The "y" command might be
 
5100
   useful too, though). See perldebug(1) and perldebtut(1) for more
 
5101
   information.
 
5102
 
5045
5103
Chapter 19. Making a Release
5046
5104
 
5047
5105
   Table of Contents