+2011-03-14 Ben Elliston <bje@gnu.org>
+
+ Reported by Flash Sheridan <flash@pobox.com>:
+ * doc/user.xml (Testing "Hello world" locally): Improve the
+ example test script and make it robust to failures. Tidy some
+ formatting errors.
+ * doc/dejagnu.texi: Regenerate.
+
2011-03-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* runtest.exp (runtest): Call reset_vars at initialisation so that
good insight into how DejaGnu works, else you might run into a lot of
subtle problems. You have been warned.
-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)
+It should be no big problems installing DejaGnu using your package
+manager or from the source code. On the Debian GNU/Linux system just
+run (as root):
@example
-apt-get install
-dejagnu
+apt-get install dejagnu
@end example
@noindent
-. These examples were run on a primary machine
-with a AMD K6 and a Mac Powerbook G3 serving as a remote
-target.
+These examples were run on a primary machine with a AMD K6 and a Mac
+Powerbook G3 serving as a remote target.
The tests for Windows were run under Windows using the actual
Cygwin version (1.3.x as of October 2001). Its target system was a PPC
@node Testing "Hello world" locally, , When trouble strikes, Our first automated tests
@subsection Testing "Hello world" locally
-This test checks, whether the built-in shell command "echo Hello world"
-will really write "Hello world" on the console.
-Create the file ~/dejagnu.test/testsuite/calc.test/local_echo.exp.
-It should contain the following lines
+This test checks whether the shell command @code{echo Hello
+world} will really output "Hello world" to the
+console. Create the file
+@file{~/dejagnu.test/testsuite/calc.test/local_echo.exp}.
+It should contain the following lines:
@strong{A first (local) test case}
@example
set test "Local Hello World"
-send "echo Hello World"
+spawn echo Hello World
expect @{
- -re "Hello World" @{ pass "$test" @}
+ "Hello World" @{ pass $test @}
+ default @{ fail $test @}
@}
@end example
good insight into how &dj; works, else you might run into a lot of
subtle problems. You have been warned.</para>
-<para>It should be no big problems installing &dj; using your
-package manager or from the source code. Under a Debian/GNU/Linux
-systems just type (as root) <programlisting>apt-get install
-dejagnu</programlisting>. These examples were run on a primary machine
-with a AMD K6 and a Mac Powerbook G3 serving as a remote
-target.</para>
+<para>It should be no big problems installing &dj; using your package
+manager or from the source code. On the Debian GNU/Linux system just
+run (as root):
+<programlisting>apt-get install dejagnu</programlisting>
+
+These examples were run on a primary machine with a AMD K6 and a Mac
+Powerbook G3 serving as a remote target.</para>
<para> The tests for Windows were run under Windows using the actual
Cygwin version (1.3.x as of October 2001). Its target system was a PPC
<sect3>
<title>Testing "Hello world" locally</title>
-<para>This test checks, whether the built-in shell command "echo Hello world"
- will really write "Hello world" on the console.
-Create the file ~/dejagnu.test/testsuite/calc.test/local_echo.exp.
-It should contain the following lines</para>
+<para>This test checks whether the shell command <command>echo Hello
+ world</command> will really output "Hello world" to the
+ console. Create the file
+ <filename>~/dejagnu.test/testsuite/calc.test/local_echo.exp</filename>.
+ It should contain the following lines:</para>
<example>
<title>A first (local) test case</title>
<programlisting>
set test "Local Hello World"
-send "echo Hello World"
+spawn echo Hello World
expect {
- -re "Hello World" { pass "$test" }
+ "Hello World" { pass $test }
+ default { fail $test }
}
</programlisting>
</example>