101 |
><TD |
><TD |
102 |
><PRE |
><PRE |
103 |
CLASS="PROGRAMLISTING" |
CLASS="PROGRAMLISTING" |
104 |
>dgt:~/dejagnu.test$ make check |
>dgt:~/dejagnu.test$ make check |
105 |
make check-DEJAGNU |
make check-DEJAGNU |
106 |
make[1]: Entering directory `/home/dgt/dejagnu.test' srcdir=`cd . && pwd`; export srcdir; \ |
make[1]: Entering directory `/home/dgt/dejagnu.test' srcdir=`cd . && pwd`; export srcdir; \ |
107 |
EXPECT=expect; export EXPECT; \ runtest=runtest; \ |
EXPECT=expect; export EXPECT; \ runtest=runtest; \ |
108 |
if /bin/sh -c "$runtest --version" > /dev/null 2>&1; then \ |
if /bin/sh -c "$runtest --version" > /dev/null 2>&1; then \ |
109 |
$runtest --tool calc CALC=`pwd`/calc --srcdir ./testsuite ; \ |
$runtest --tool calc CALC=`pwd`/calc --srcdir ./testsuite ; \ |
110 |
else echo "WARNING: could not find \`runtest'" 1>&2; :;\ |
else echo "WARNING: could not find \`runtest'" 1>&2; :;\ |
111 |
fi |
fi |
112 |
WARNING: Couldn't find the global config file. |
WARNING: Couldn't find the global config file. |
113 |
WARNING: Couldn't find tool init file |
WARNING: Couldn't find tool init file |
114 |
Test Run By dgt on Sun Nov 25 21:42:21 2001 |
Test Run By dgt on Sun Nov 25 21:42:21 2001 |
115 |
Native configuration is i586-pc-linux-gnu |
Native configuration is i586-pc-linux-gnu |
116 |
|
|
117 |
=== calc tests === |
=== calc tests === |
118 |
|
|
119 |
Schedule of variations: |
Schedule of variations: |
120 |
unix |
unix |
121 |
|
|
122 |
Running target unix |
Running target unix |
123 |
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. |
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. |
124 |
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. |
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. |
125 |
Using ./testsuite/config/unix.exp as tool-and-target-specific interface file. |
Using ./testsuite/config/unix.exp as tool-and-target-specific interface file. |
126 |
Running ./testsuite/calc.test/calc.exp ... |
Running ./testsuite/calc.test/calc.exp ... |
127 |
FAIL: multiply2 (bad match) |
FAIL: multiply2 (bad match) |
128 |
|
|
129 |
=== calc Summary === |
=== calc Summary === |
130 |
|
|
131 |
# of expected passes 5 |
# of expected passes 5 |
132 |
# of unexpected failures 1 |
# of unexpected failures 1 |
133 |
/home/Dgt/dejagnu.test/calc version Version: 1.1 |
/home/Dgt/dejagnu.test/calc version Version: 1.1 |
134 |
make[1]: *** [check-DEJAGNU] Fehler 1 |
make[1]: *** [check-DEJAGNU] Fehler 1 |
135 |
make[1]: Leaving directory `/home/Dgt/dejagnu.test' make: *** [check-am] Fehler 2</PRE |
make[1]: Leaving directory `/home/Dgt/dejagnu.test' make: *** [check-am] Fehler 2</PRE |
136 |
></TD |
></TD |
137 |
></TR |
></TR |
140 |
><P |
><P |
141 |
>Did you see the line “FAIL:“? The test cases for calc catch the bug in the calc.c file. Fix the error in calc.c later as the following examples assume a unchanged calc.c.</P |
>Did you see the line “FAIL:“? The test cases for calc catch the bug in the calc.c file. Fix the error in calc.c later as the following examples assume a unchanged calc.c.</P |
142 |
><P |
><P |
143 |
>Examine the output files calc.sum and calc.log. |
>Examine the output files calc.sum and calc.log. |
144 |
Try to understand the testcases written in ~/dejagnu.test/testsuite/calc.test/calc.exp. |
Try to understand the testcases written in ~/dejagnu.test/testsuite/calc.test/calc.exp. |
145 |
To understand Expect you might take a look at the book "Exploring Expect", |
To understand Expect you might take a look at the book "Exploring Expect", |
146 |
which is an excellent resource for learning and using Expect. (Pub: O'Reilly, ISBN 1-56592-090-2) |
which is an excellent resource for learning and using Expect. (Pub: O'Reilly, ISBN 1-56592-090-2) |
147 |
The book contains hundreds of examples and also includes a tutorial on Tcl. |
The book contains hundreds of examples and also includes a tutorial on Tcl. |
148 |
Exploring Expect is 602 pages long. </P |
Exploring Expect is 602 pages long. </P |
149 |
></DIV |
></DIV |
150 |
><DIV |
><DIV |
170 |
></TR |
></TR |
171 |
></TABLE |
></TABLE |
172 |
><P |
><P |
173 |
>Rerun make check. Test whether the output contains "I am ~/.dejagnurc". |
>Rerun make check. Test whether the output contains "I am ~/.dejagnurc". |
174 |
Create ~/my_dejagnu.exp and insert the following line:</P |
Create ~/my_dejagnu.exp and insert the following line:</P |
175 |
><TABLE |
><TABLE |
176 |
BORDER="0" |
BORDER="0" |
199 |
></TR |
></TR |
200 |
></TABLE |
></TABLE |
201 |
><P |
><P |
202 |
>Run “make check” again. The output should not contain |
>Run “make check” again. The output should not contain |
203 |
“WARNING: Couldn't find the global config file.”. |
“WARNING: Couldn't find the global config file.”. |
204 |
Create the sub-directory lib. Create the file “calc.exp” in it and insert the following line:</P |
Create the sub-directory lib. Create the file “calc.exp” in it and insert the following line:</P |
205 |
><TABLE |
><TABLE |
206 |
BORDER="0" |
BORDER="0" |
215 |
></TR |
></TR |
216 |
></TABLE |
></TABLE |
217 |
><P |
><P |
218 |
>The last warning “WARNING: Couldn't find tool init file” |
>The last warning “WARNING: Couldn't find tool init file” |
219 |
should not be part of the output of make check. |
should not be part of the output of make check. |
220 |
Create the directory ˜/boards. Create the file ˜/boards/standard.exp and insert the following line:</P |
Create the directory ˜/boards. Create the file ˜/boards/standard.exp and insert the following line:</P |
221 |
><TABLE |
><TABLE |
222 |
BORDER="0" |
BORDER="0" |
249 |
><TD |
><TD |
250 |
><PRE |
><PRE |
251 |
CLASS="PROGRAMLISTING" |
CLASS="PROGRAMLISTING" |
252 |
>dgt:~/dejagnu.test$ make check |
>dgt:~/dejagnu.test$ make check |
253 |
<...> |
<...> |
254 |
fi |
fi |
255 |
I am ~/.dejagnurc |
I am ~/.dejagnurc |
256 |
I am ~/my_dejagnu.exp |
I am ~/my_dejagnu.exp |
257 |
I am lib/calc.exp |
I am lib/calc.exp |
258 |
Test Run By dgt on Sun Nov 25 22:19:14 2001 |
Test Run By dgt on Sun Nov 25 22:19:14 2001 |
259 |
Native configuration is i586-pc-linux-gnu |
Native configuration is i586-pc-linux-gnu |
260 |
|
|
261 |
=== calc tests === |
=== calc tests === |
262 |
Using /home/Dgt/boards/standard.exp as standard board description\ |
Using /home/Dgt/boards/standard.exp as standard board description\ |
263 |
file for build. |
file for build. |
264 |
I am ~/boards/standard.exp |
I am ~/boards/standard.exp |
265 |
Using /home/Dgt/boards/standard.exp as standard board description\ |
Using /home/Dgt/boards/standard.exp as standard board description\ |
266 |
file for host. |
file for host. |
267 |
I am ~/boards/standard.exp |
I am ~/boards/standard.exp |
268 |
|
|
269 |
Schedule of variations: |
Schedule of variations: |
270 |
unix |
unix |
271 |
|
|
272 |
Running target unix |
Running target unix |
273 |
Using /home/Dgt/boards/standard.exp as standard board description\ |
Using /home/Dgt/boards/standard.exp as standard board description\ |
274 |
file for target. |
file for target. |
275 |
I am ~/boards/standard.exp |
I am ~/boards/standard.exp |
276 |
Using /usr/share/dejagnu/baseboards/unix.exp as board description file\ |
Using /usr/share/dejagnu/baseboards/unix.exp as board description file\ |
277 |
for target. |
for target. |
278 |
<...></PRE |
<...></PRE |
279 |
></TD |
></TD |
280 |
></TR |
></TR |
282 |
></DIV |
></DIV |
283 |
><P |
><P |
284 |
>It is up to you to decide when and where to use any of the above |
>It is up to you to decide when and where to use any of the above |
285 |
mentioned config files for customizing. |
mentioned config files for customizing. |
286 |
This chapters showed you where and in which order the different config |
This chapters showed you where and in which order the different config |
287 |
files are run.</P |
files are run.</P |
288 |
></DIV |
></DIV |
289 |
><DIV |
><DIV |
345 |
></H2 |
></H2 |
346 |
><P |
><P |
347 |
>This test checks, whether the built-in shell command “echo Hello world” |
>This test checks, whether the built-in shell command “echo Hello world” |
348 |
will really write “Hello world” on the console. |
will really write “Hello world” on the console. |
349 |
Create the file ~/dejagnu.test/testsuite/calc.test/local_echo.exp. |
Create the file ~/dejagnu.test/testsuite/calc.test/local_echo.exp. |
350 |
It should contain the following lines</P |
It should contain the following lines</P |
351 |
><DIV |
><DIV |
352 |
CLASS="EXAMPLE" |
CLASS="EXAMPLE" |
365 |
><TD |
><TD |
366 |
><PRE |
><PRE |
367 |
CLASS="PROGRAMLISTING" |
CLASS="PROGRAMLISTING" |
368 |
>set test "Local Hello World" |
>set test "Local Hello World" |
369 |
send "echo Hello World" |
send "echo Hello World" |
370 |
expect { |
expect { |
371 |
-re "Hello World" { pass "$test" } |
-re "Hello World" { pass "$test" } |
372 |
}</PRE |
}</PRE |
373 |
></TD |
></TD |
374 |
></TR |
></TR |
437 |
></DIV |
></DIV |
438 |
></BODY |
></BODY |
439 |
></HTML |
></HTML |
|
> |
|
440 |
|
> |