* debian/changelog: Add entry for new release.
[dejagnu.git] / doc / overview / adding.html
blobfb6ff34c82de818f266520bc543f7370b1c526f5
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Adding A Test Case To A Test Suite.</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
8 REL="HOME"
9 TITLE="DejaGnu"
10 HREF="book1.html"><LINK
11 REL="UP"
12 TITLE="Extending DejaGnu"
13 HREF="extending.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Debugging A Test Case"
16 HREF="debugging.html"><LINK
17 REL="NEXT"
18 TITLE="Hints On Writing A Test Case"
19 HREF="hints.html"></HEAD
20 ><BODY
21 ><DIV
22 CLASS="NAVHEADER"
23 ><TABLE
24 WIDTH="100%"
25 BORDER="0"
26 CELLPADDING="0"
27 CELLSPACING="0"
28 ><TR
29 ><TH
30 COLSPAN="3"
31 ALIGN="center"
32 >DejaGnu: The GNU Testing Framework</TH
33 ></TR
34 ><TR
35 ><TD
36 WIDTH="10%"
37 ALIGN="left"
38 VALIGN="bottom"
39 ><A
40 HREF="debugging.html"
41 >Prev</A
42 ></TD
43 ><TD
44 WIDTH="80%"
45 ALIGN="center"
46 VALIGN="bottom"
47 >Chapter 4. Extending DejaGnu</TD
48 ><TD
49 WIDTH="10%"
50 ALIGN="right"
51 VALIGN="bottom"
52 ><A
53 HREF="hints.html"
54 >Next</A
55 ></TD
56 ></TR
57 ></TABLE
58 ><HR
59 ALIGN="LEFT"
60 WIDTH="100%"></DIV
61 ><DIV
62 CLASS="SECT1"
63 ><H1
64 CLASS="SECT1"
65 ><A
66 NAME="ADDING"
67 >Adding A Test Case To A Test Suite.</A
68 ></H1
69 ><P
70 >There are two slightly different ways to add a test
71 case. One is to add the test case to an existing directory. The
72 other is to create a new directory to hold your test. The
73 existing test directories represent several styles of testing,
74 all of which are slightly different; examine the directories for
75 the tool of interest to see which (if any) is most suitable.</P
76 ><P
77 >Adding a GCC test can be very simple: just add the C code
78 to any directory beginning with <TT
79 CLASS="FILENAME"
80 >gcc</TT
81 >. and it
82 runs on the next <TABLE
83 BORDER="0"
84 BGCOLOR="#E0E0E0"
85 WIDTH="100%"
86 ><TR
87 ><TD
88 ><PRE
89 CLASS="PROGRAMLISTING"
90 >runtest --tool
91 gcc</PRE
92 ></TD
93 ></TR
94 ></TABLE
95 >.</P
96 ><P
97 >To add a test to GDB, first add any source code you will
98 need to the test directory. Then you can either create a new
99 expect file, or add your test to an existing one (any
100 file with a <I
101 CLASS="EMPHASIS"
102 >.exp</I
103 > suffix). Creating a new
104 .exp file is probably a better idea if the test is significantly
105 different from existing tests. Adding it as a separate file also
106 makes upgrading easier. If the C code has to be already compiled
107 before the test will run, then you'll have to add it to the
109 CLASS="FILENAME"
110 >Makefile.in</TT
111 > file for that test directory,
112 then run <B
113 CLASS="COMMAND"
114 >configure</B
115 > and
117 CLASS="COMMAND"
118 >make</B
119 >.</P
121 >Adding a test by creating a new directory is very
122 similar:</P
124 ></P
125 ><UL
126 ><LI
127 STYLE="list-style-type: disc"
129 >Create the new directory. All subdirectory names
130 begin with the name of the tool to test; e.g. G++ tests might be
131 in a directory called <TT
132 CLASS="FILENAME"
133 >g++.other</TT
134 >. There can
135 be multiple test directories that start with the same tool name
136 (such as <I
137 CLASS="EMPHASIS"
138 >g++</I
139 >).</P
140 ></LI
141 ><LI
142 STYLE="list-style-type: disc"
144 >Add the new directory name to the
145 <SPAN
146 CLASS="SYMBOL"
147 >configdirs</SPAN
148 > definition in the
150 CLASS="FILENAME"
151 >configure.in</TT
152 > file for the test suite
153 directory. This way when <B
154 CLASS="COMMAND"
155 >make</B
156 > and
158 CLASS="COMMAND"
159 >configure</B
160 > next run, they include the new
161 directory.</P
162 ></LI
163 ><LI
164 STYLE="list-style-type: disc"
166 >Add the new test case to the directory, as
167 above. </P
168 ></LI
169 ><LI
170 STYLE="list-style-type: disc"
172 >To add support in the new directory for
173 configure and make, you must also create a
175 CLASS="FILENAME"
176 >Makefile.in</TT
177 > and a
179 CLASS="FILENAME"
180 >configure.in</TT
181 >.</P
182 ></LI
183 ></UL
184 ></DIV
185 ><DIV
186 CLASS="NAVFOOTER"
187 ><HR
188 ALIGN="LEFT"
189 WIDTH="100%"><TABLE
190 WIDTH="100%"
191 BORDER="0"
192 CELLPADDING="0"
193 CELLSPACING="0"
194 ><TR
195 ><TD
196 WIDTH="33%"
197 ALIGN="left"
198 VALIGN="top"
200 HREF="debugging.html"
201 >Prev</A
202 ></TD
203 ><TD
204 WIDTH="34%"
205 ALIGN="center"
206 VALIGN="top"
208 HREF="book1.html"
209 >Home</A
210 ></TD
211 ><TD
212 WIDTH="33%"
213 ALIGN="right"
214 VALIGN="top"
216 HREF="hints.html"
217 >Next</A
218 ></TD
219 ></TR
220 ><TR
221 ><TD
222 WIDTH="33%"
223 ALIGN="left"
224 VALIGN="top"
225 >Debugging A Test Case</TD
226 ><TD
227 WIDTH="34%"
228 ALIGN="center"
229 VALIGN="top"
231 HREF="extending.html"
232 >Up</A
233 ></TD
234 ><TD
235 WIDTH="33%"
236 ALIGN="right"
237 VALIGN="top"
238 >Hints On Writing A Test Case</TD
239 ></TR
240 ></TABLE
241 ></DIV
242 ></BODY
243 ></HTML