1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN">
5 >Getting DejaGnu up and running
</TITLE
8 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.76b+
12 HREF=
"book1.html"><LINK
14 TITLE=
"A POSIX conforming test framework"
15 HREF=
"x134.html"><LINK
17 TITLE=
"Create a minimal project, e.g. calc"
18 HREF=
"x227.html"></HEAD
29 SUMMARY=
"Header navigation table"
38 >DejaGnu: The GNU Testing Framework
</TH
48 ><<< Previous
</A
62 >Next
>>></A
75 >Getting DejaGnu up and running
</H1
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
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
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
88 CLASS=
"PROGRAMLISTING"
93 >. These examples were run on a primary machine with a AMD K6 and a Mac Powerbook G3 serving as a remote target.
</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
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
113 CLASS=
"PROGRAMLISTING"
114 >dgt:~$ mkdir ~/dejagnu.test
115 dgt:~$ cd ~/dejagnu.test
</PRE
120 >Now you are ready to test DejaGnu's main program called runtest. The expecteted output is shown
</P
128 >Example
1. Runtest output in a empty directory
</B
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
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.
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
160 CLASS=
"PROGRAMLISTING"
161 >:~/dejagnu.test$ rm testrun.sum testrun.log
</PRE
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
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
199 SUMMARY=
"Footer navigation table"
212 ><<< Previous
</A
230 >Next
>>></A
238 >A POSIX conforming test framework
</TD
248 >Create a minimal project, e.g. calc
</TD