1 <chapter id="cvs-regression">
2 <title>How to do regression testing using Cvs</title>
8 (Extracted from <filename>wine/documentation/bugreports</filename>)
12 A problem that can happen sometimes is 'it used to work
13 before, now it doesn't anymore...'. Here is a step by step
14 procedure to try to pinpoint when the problem occured. This is
15 <emphasis>NOT</emphasis> for casual users.
21 Get the 'full cvs' archive from winehq. This archive is
22 the cvs tree but with the tags controlling the versioning
23 system. It's a big file (> 15 meg) with a name like
24 full-cvs-<last update date> (it's more than 100mb
25 when uncompressed, you can't very well do this with
26 small, old computers or slow Internet connections).
31 untar it into a repository directory:
34 tar -zxffull-cvs-2000-05-20.tar.gz
41 extract a new destination directory. This directory must
42 not be in a subdirectory of the repository else
43 <command>cvs</command> will think it's part of the
44 repository and deny you an extraction in the repository:
47 mv wine wine_current (-> this protects your current wine sandbox, if any)
48 export CVSROOT=/home/gerard/repository
50 cvs -d $CVSROOT checkout wine
54 Note that it's not possible to do a checkout at a given
55 date; you always do the checkout for the last date where
56 the full-cvs-xxx snapshot was generated.
61 you will have now in the <filename>~/wine</filename>
62 directory an image of the cvs tree, on the client side.
63 Now update this image to the date you want:
66 cvs -d $CVSROOT update -D "1999-06-01"
70 The date format is <literal>YYYY-MM-DD</literal>.
73 Many messages will inform you that more recent files have
74 been deleted to set back the client cvs tree to the date
75 you asked, for example:
77 cvs update: tsx11/ts_xf86dga2.c is no longer in the repository
81 <command>cvs update</command> is not limited to upgrade to
82 a <emphasis>newer</emphasis> version as I have believed for far too long :-(
87 Now proceed as for a normal update:
94 When you have found the exact date when a bug was added to
95 the cvs tree, use something like :
97 cvs -d $CVSROOT diff -D "1999-07-10" -D "1999-07-12"
99 to get all the differences between the last cvs tree
100 version known to work and code that first displayed the
105 I did not include flags for <command>diff</command>
106 since they are in my <filename>.cvsrc</filename> file:
115 From this diff file, particularly the file names, and the
116 <filename>ChangeLog</filename>, it's usually possible to
117 find the different individual patches that were done at
121 If any non-programmer reads this, the fastest method to get
122 at the point where the problem occured is to use a binary
123 search, that is, if the problem occured in 1999, start at
124 mid-year, then is the problem is already here, back to 1st
125 April, if not, to 1st October, and so on.
130 The next step is to start from the last working version
131 and to dig the individual contributions from
132 <ulink url="http://www.integrita.com/cgi-local/lwgate.pl/WINE-PATCHES/">
133 http://www.integrita.com/cgi-local/lwgate.pl/WINE-PATCHES/</ulink>
134 (where the Wine patches mailing list is archived)
137 If the patch was done by the Wine maintainer or if it was
138 sent directly to his mail address without going first through
139 <ulink url="mailto:wine-patches@winehq.com">wine-patches</ulink>,
140 you are out of luck as you will never find the patch in
141 the archive. If it is, it's often possible to apply the
142 patches one by one to last working cvs snapshot, compile and test.
143 If you have saved the next candidate as
144 <filename>/home/gerard/buggedpatch1.txt</filename>:
148 patch -p 0 < /home/gerard/buggedpatch1.txt
151 Beware that the committed patch is not always identical to
152 the patch that the author sent to wine-patches, as
153 sometimes the Wine maintainer changes things a bit.
156 If you find one patch that is getting the cvs source tree to
157 reproduce the problem, you have almost won; post the problem on
158 <systemitem>comp.emulators.windows.wine</systemitem> and there
159 is a chance that the author will jump in to suggest a fix; or
160 there is always the possibility to look hard at the patch until
161 it is coerced to reveal where is the bug :-)
167 <!-- Keep this comment at the end of the file
170 sgml-parent-document:("wine-doc.sgml" "set" "book" "part" "chapter" "")