First version committed to git
[zpugcc/jano.git] / toolchain / dejagnu / doc / html / c203.html
blob9a79de008b5d8ae3a13249e0aa56aa9db63178b2
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Getting DejaGnu up and running</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
9 "><LINK
10 REL="HOME"
11 TITLE="DejaGnu"
12 HREF="book1.html"><LINK
13 REL="PREVIOUS"
14 TITLE="A POSIX conforming test framework"
15 HREF="x134.html"><LINK
16 REL="NEXT"
17 TITLE="Create a minimal project, e.g. calc"
18 HREF="x227.html"></HEAD
19 ><BODY
20 CLASS="CHAPTER"
21 BGCOLOR="#FFFFFF"
22 TEXT="#000000"
23 LINK="#0000FF"
24 VLINK="#840084"
25 ALINK="#0000FF"
26 ><DIV
27 CLASS="NAVHEADER"
28 ><TABLE
29 SUMMARY="Header navigation table"
30 WIDTH="100%"
31 BORDER="0"
32 CELLPADDING="0"
33 CELLSPACING="0"
34 ><TR
35 ><TH
36 COLSPAN="3"
37 ALIGN="center"
38 >DejaGnu: The GNU Testing Framework</TH
39 ></TR
40 ><TR
41 ><TD
42 WIDTH="10%"
43 ALIGN="left"
44 VALIGN="bottom"
45 ><A
46 HREF="x134.html"
47 ACCESSKEY="P"
48 >&#60;&#60;&#60; Previous</A
49 ></TD
50 ><TD
51 WIDTH="80%"
52 ALIGN="center"
53 VALIGN="bottom"
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="right"
58 VALIGN="bottom"
59 ><A
60 HREF="x227.html"
61 ACCESSKEY="N"
62 >Next &#62;&#62;&#62;</A
63 ></TD
64 ></TR
65 ></TABLE
66 ><HR
67 ALIGN="LEFT"
68 WIDTH="100%"></DIV
69 ><DIV
70 CLASS="CHAPTER"
71 ><H1
72 ><A
73 NAME="GETTINGUP"
74 ></A
75 >Getting DejaGnu up and running</H1
76 ><P
77 >This chapter was originally written by Niklaus Giger (ngiger@mus.ch) because he lost a week to figure out how DejaGnu works and how to write a first test.</P
78 ><P
79 >Follow these instructions as closely a possible in order get a good insight into how DejaGnu works, else you might run into a lot of subtle problems. You have been warned.</P
80 ><P
81 >It should be no big problems installing DejaGnu using your package manager or from the source code. Under a Debian/GNU/Linux systems just type (as root) <TABLE
82 BORDER="0"
83 BGCOLOR="#E0E0E0"
84 WIDTH="100%"
85 ><TR
86 ><TD
87 ><PRE
88 CLASS="PROGRAMLISTING"
89 >apt-get dejagnu</PRE
90 ></TD
91 ></TR
92 ></TABLE
93 >. These examples were run on a primary machine with a AMD K6 and a Mac Powerbook G3 serving as a remote target.</P
94 ><P
95 > The tests for Windows were run under Windows NT using the actual Cygwin version (1.3.x as of October 2001). It's target system was a PPC embedded system running vxWorks.</P
96 ><DIV
97 CLASS="SECT1"
98 ><H1
99 CLASS="SECT1"
101 NAME="AEN210"
102 ></A
103 >Test your installation</H1
105 >Create a new user called "dgt" (DejaGnuTest), which uses bash as it login shell. PS1 must be set to '\u:\w\$ ' in its ~/.bashrc. Login as this user, create an empty directory and change the working directory to it. e.g</P
106 ><TABLE
107 BORDER="0"
108 BGCOLOR="#E0E0E0"
109 WIDTH="100%"
110 ><TR
111 ><TD
112 ><PRE
113 CLASS="PROGRAMLISTING"
114 >dgt:~$ mkdir ~/dejagnu.test
115 dgt:~$ cd ~/dejagnu.test</PRE
116 ></TD
117 ></TR
118 ></TABLE
120 >Now you are ready to test DejaGnu's main program called runtest. The expecteted output is shown</P
121 ><DIV
122 CLASS="EXAMPLE"
124 NAME="AEN215"
125 ></A
128 >Example 1. Runtest output in a empty directory</B
129 ></P
130 ><TABLE
131 BORDER="0"
132 BGCOLOR="#E0E0E0"
133 WIDTH="100%"
134 ><TR
135 ><TD
136 ><PRE
137 CLASS="PROGRAMLISTING"
138 >dgt:~/dejagnu.test$ runtest
139 WARNING: Couldn't find the global config file.
140 WARNING: No tool specified Test
141 Run By dgt on Sun Nov 25 17:07:03 2001 Native configuration is i586-pc-linux-gnu
142 === tests ===
143 Schedule of variations: unix
144 Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
145 Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
146 ERROR: Couldn't find tool config file for unix.
147 === Summary ===</PRE
148 ></TD
149 ></TR
150 ></TABLE
152 >We will show you later how to get rid of all the WARNING- and ERROR-messages. The files testrun.sum and testrun.log have been created, which do not interest us at this point. Let's remove them.</P
153 ><TABLE
154 BORDER="0"
155 BGCOLOR="#E0E0E0"
156 WIDTH="100%"
157 ><TR
158 ><TD
159 ><PRE
160 CLASS="PROGRAMLISTING"
161 >:~/dejagnu.test$ rm testrun.sum testrun.log</PRE
162 ></TD
163 ></TR
164 ></TABLE
165 ></DIV
166 ><DIV
167 CLASS="SECT2"
168 ><H2
169 CLASS="SECT2"
171 NAME="AEN220"
172 ></A
173 >Windows</H2
175 >On Windows systems DejaGnu is part of a port of a lot of Unix tools to the Windows OS, called Cygwin. Cygwin may be downloaded and installed from a mirror of http://www.cygwin.com/. All examples were also run on Windows NT. If nothing is said, you can assume that you should get the same output as on a Unix system.</P
177 >You will need a telnet daemon if you want to use a Windows box as a remote target. There seems to be a freeware telnet daemon at http://www.fictional.net/.</P
178 ></DIV
179 ><DIV
180 CLASS="SECT2"
181 ><H2
182 CLASS="SECT2"
184 NAME="AEN224"
185 ></A
186 >Getting the source code for the calc example</H2
188 >If you are running a Debian distribution you can find the examples under /usr/share/doc/dejagnu/examples.
189 These examples seem to be missing in Red Hat's RPM.
190 In this case download the sources of DejaGnu and adjust the pathes to the DejaGnu examples accordingly.</P
191 ></DIV
192 ></DIV
193 ></DIV
194 ><DIV
195 CLASS="NAVFOOTER"
196 ><HR
197 ALIGN="LEFT"
198 WIDTH="100%"><TABLE
199 SUMMARY="Footer navigation table"
200 WIDTH="100%"
201 BORDER="0"
202 CELLPADDING="0"
203 CELLSPACING="0"
204 ><TR
205 ><TD
206 WIDTH="33%"
207 ALIGN="left"
208 VALIGN="top"
210 HREF="x134.html"
211 ACCESSKEY="P"
212 >&#60;&#60;&#60; Previous</A
213 ></TD
214 ><TD
215 WIDTH="34%"
216 ALIGN="center"
217 VALIGN="top"
219 HREF="book1.html"
220 ACCESSKEY="H"
221 >Home</A
222 ></TD
223 ><TD
224 WIDTH="33%"
225 ALIGN="right"
226 VALIGN="top"
228 HREF="x227.html"
229 ACCESSKEY="N"
230 >Next &#62;&#62;&#62;</A
231 ></TD
232 ></TR
233 ><TR
234 ><TD
235 WIDTH="33%"
236 ALIGN="left"
237 VALIGN="top"
238 >A POSIX conforming test framework</TD
239 ><TD
240 WIDTH="34%"
241 ALIGN="center"
242 VALIGN="top"
243 >&nbsp;</TD
244 ><TD
245 WIDTH="33%"
246 ALIGN="right"
247 VALIGN="top"
248 >Create a minimal project, e.g. calc</TD
249 ></TR
250 ></TABLE
251 ></DIV
252 ></BODY
253 ></HTML