blob: 89710411114f88c4c2bc7a2acee4dde4e72f7239 [file] [log] [blame]
{\rtf1\ansi\deff0
{\fonttbl{\f3\fnil\fcharset0 Courier New;}
{\f2\fnil\fcharset0 Helvetica;}
{\f4\fnil\fcharset0 Arial;}
{\f1\fnil\fcharset0 Palatino;}
{\f0\fnil\fcharset0 Times New Roman;}
}
{\colortbl;}{\stylesheet{\s1 Heading 1;}{\s2 Heading 2;}{\s3 Heading 3;}{\s4 Heading 4;}{\s5 Heading 5;}{\s6 Heading 6;}{\s7 Heading 7;}{\s8 Heading 8;}{\s9 Heading 9;}}
\deflang1024\notabind\facingp\hyphauto1\widowctrl
\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}\pard\sl20 \fs20\f1 \hyphpar0\par\pard\sb242\s1\sl354\qc \b\fs32\f2 DejaGnu\keepn\hyphpar0\par\pard\sb220\sl322 \fs29 The GNU Testing Framework\keepn\hyphpar0\par\pard\sl220 \b0\fs20\f1 \~\hyphpar0\par\pard\sb1288\sl293\qc \b\fs26\f2 Rob Savoye\keepn\hyphpar0\par\pard\sl220\qc \fs22 Free Software Foundation\hyphpar0\par\page\pard\sl20 \b0\fs20\f1 \hyphpar0\par\pard\sl-240 \b\f2 DejaGnu: The GNU Testing Framework\hyphpar0\par\pard\sl220 \b0\f1 by\~Rob Savoye\hyphpar0\par\pard\sb220\sl220 1.4.4\~Edition \hyphpar0\par\pard\sl220 Copyright\~\'a9\~2002 by Free Software Foundation, Inc.\hyphpar0\par\pard\sb200\sl220 Revision History\sa83\par\trowd\trql \clvertalt\cellx2800\clvertalt\cellx5600\clvertalt\cellx8400 \plain \pard\intbl\sl220 \fs20\f1 Revision 0.6.2\cell \plain \pard\intbl\li120\sl220 \fs20\f1 2002-7-16\cell \plain \pard\intbl\li120\sl220 \fs20\f1 Revised by: rob@welcomehome.org\cell \row \trowd\trql \clvertalt\cellx8400 \plain \pard\intbl\sl220 \fs20\f1 Add new tutorial as a new chapter.\sa100\cell \row \trowd\trql \clvertalt\cellx2800\clvertalt\cellx5600\clvertalt\cellx8400 \plain \pard\intbl\sl220 \fs20\f1 Revision 0.6.1\cell \plain \pard\intbl\li120\sl220 \fs20\f1 2001-2-16\cell \plain \pard\intbl\li120\sl220 \fs20\f1 Revised by: rob@welcomehome.org\cell \row \trowd\trql \clvertalt\cellx8400 \plain \pard\intbl\sl220 \fs20\f1 Add info on the new dejagnu.h file.\sa100\cell \row \trowd\trql \clvertalt\cellx2800\clvertalt\cellx5600\clvertalt\cellx8400 \plain \pard\intbl\sl220 \fs20\f1 Revision 0.6\cell \plain \pard\intbl\li120\sl220 \fs20\f1 2001-2-16\cell \plain \pard\intbl\li120\sl220 \fs20\f1 Revised by: rob@welcomehome.org\cell \row \trowd\trql \clvertalt\cellx8400 \plain \pard\intbl\sl220 \fs20\f1 Updated for new release.\sa100\cell \row \trowd\trql \clvertalt\cellx2800\clvertalt\cellx5600\clvertalt\cellx8400 \plain \pard\intbl\sl220 \fs20\f1 Revision 0.5\cell \plain \pard\intbl\li120\sl220 \fs20\f1 2000-1-24\cell \plain \pard\intbl\li120\sl220 \fs20\f1 Revised by: rob@welcomehome.org\cell \row \trowd\trql \clvertalt\cellx8400 \plain \pard\intbl\sl220 \fs20\f1 Initial version after conversion to DocBook.\cell \row \pard\plain\sl-1\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgnlcrm\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 \b\fs29\f2 Table of Contents\keepn\hyphpar0\par\pard\sb146\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_PREFACE}{\fldrslt \fs20\f1 Abstract}}\fs20\f1 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_PREFACE}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_PREFACE}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_OVERVIEW}{\fldrslt 1. Overview}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_OVERVIEW}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_OVERVIEW}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_WHATIS}{\fldrslt \b0 What is DejaGnu ?}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_WHATIS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_WHATIS}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_NEW}{\fldrslt What's New In This Release}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_NEW}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_NEW}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_CYGWIN}{\fldrslt Windows Support}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_CYGWIN}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_CYGWIN}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_DESIGNGOALS}{\fldrslt Design Goals}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_DESIGNGOALS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_DESIGNGOALS}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_POSIX}{\fldrslt A POSIX conforming test framework}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_POSIX}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_POSIX}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_GETTINGUP}{\fldrslt \b 2. Getting DejaGnu up and running}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_GETTINGUP}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_GETTINGUP}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _209 }{\fldrslt \b0 Test your installation}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _209 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _209}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _219 }{\fldrslt Windows}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _219 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _219}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _223 }{\fldrslt Getting the source code for the calc example}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _223 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _223}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _226 }{\fldrslt Create a minimal project, e.g. calc}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _226 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _226}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _229 }{\fldrslt A simple project without the GNU autotools}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _229 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _229}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _234 }{\fldrslt Using autoconf/autoheader/automake}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _234 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _234}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _275 }{\fldrslt Our first automated tests}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _275 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _275}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _277 }{\fldrslt Running the test for the calc example}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _277 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _277}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _285 }{\fldrslt The various config files or how to avoid warnings}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _285 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _285}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _302 }{\fldrslt When trouble strikes}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _302 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _302}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _311 }{\fldrslt Testing \'93Hello world\'94 locally}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _311 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _311}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _318 }{\fldrslt A first remote test}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _318 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _318}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _321 }{\fldrslt Setup telnet to your own host}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _321 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _321}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _330 }{\fldrslt A test case for login via telnet}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _330 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _330}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _356 }{\fldrslt Remote testing \'93Hello world\'94}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _356 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _356}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _371 }{\fldrslt Transferring files from/to the target}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _371 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _371}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _381 }{\fldrslt Preparing for crosscompilation}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _381 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _381}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _392 }{\fldrslt Remote testing of calc}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _392 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _392}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l _395 }{\fldrslt Using Windows as host and vxWorks as target}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l _395 }{\fldrslt {\field\flddirty{\*\fldinst PAGEREF _395}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_RUNNINGTESTS}{\fldrslt \b 3. Running Tests}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_RUNNINGTESTS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_RUNNINGTESTS}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_MAKECHECK}{\fldrslt \b0 Make check}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_MAKECHECK}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_MAKECHECK}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_RUNTEST}{\fldrslt Runtest}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_RUNTEST}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_RUNTEST}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_OUTPUTS}{\fldrslt Output States}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_OUTPUTS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_OUTPUTS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_INVOKING}{\fldrslt Invoking Runtest}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_INVOKING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_INVOKING}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_COMMON}{\fldrslt Common Options}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_COMMON}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_COMMON}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_OUTPUTFILES}{\fldrslt The files DejaGnu produces.}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_OUTPUTFILES}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_OUTPUTFILES}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_SUM}{\fldrslt Summary File}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_SUM}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_SUM}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_LOG}{\fldrslt Log File}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_LOG}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_LOG}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_DEBUGFILE}{\fldrslt Debug Log File}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_DEBUGFILE}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_DEBUGFILE}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_CUSTOMIZING}{\fldrslt \b 4. Customizing DejaGnu}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_CUSTOMIZING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_CUSTOMIZING}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_LOCAL}{\fldrslt \b0 Local Config File}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_LOCAL}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_LOCAL}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_GLOBAL}{\fldrslt Global Config File}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_GLOBAL}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_GLOBAL}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_BOARDCONFIG}{\fldrslt Board Config File}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_BOARDCONFIG}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_BOARDCONFIG}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_RELENG}{\fldrslt Remote Host Testing}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_RELENG}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_RELENG}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_CONFIGFILE}{\fldrslt Config File Values}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_CONFIGFILE}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_CONFIGFILE}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_OPTIONDEFS}{\fldrslt Command Line Option Variables}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_OPTIONDEFS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_OPTIONDEFS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_PERSONAL}{\fldrslt Personal Config File}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_PERSONAL}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_PERSONAL}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_EXTENDING}{\fldrslt \b 5. Extending DejaGnu}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_EXTENDING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_EXTENDING}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_ADDSUITE}{\fldrslt \b0 Adding A New Testsuite}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_ADDSUITE}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_ADDSUITE}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_ADDTOOL}{\fldrslt Adding A New Tool}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_ADDTOOL}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_ADDTOOL}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_ADDTARGET}{\fldrslt Adding A New Target}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_ADDTARGET}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_ADDTARGET}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_ADDBOARD}{\fldrslt Adding A New Board}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_ADDBOARD}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_ADDBOARD}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_BOARDDEFS}{\fldrslt Board Config File Values}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_BOARDDEFS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_BOARDDEFS}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_WRITING}{\fldrslt Writing A Test Case}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_WRITING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_WRITING}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_DEBUGGING}{\fldrslt Debugging A Test Case}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_DEBUGGING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_DEBUGGING}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_ADDING}{\fldrslt Adding A Test Case To A Testsuite.}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_ADDING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_ADDING}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_HINTS}{\fldrslt Hints On Writing A Test Case}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_HINTS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_HINTS}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_TVARIABLES}{\fldrslt Special variables used by test cases.}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_TVARIABLES}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_TVARIABLES}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_UNIT}{\fldrslt \b 6. Unit Testing}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_UNIT}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_UNIT}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_UNITTEST}{\fldrslt \b0 What Is Unit Testing ?}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_UNITTEST}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_UNITTEST}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_DJH}{\fldrslt The dejagnu.h Header File}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_DJH}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_DJH}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_REFERENCE}{\fldrslt \b 7. Reference}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_REFERENCE}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_REFERENCE}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_OBTAINING}{\fldrslt \b0 Obtaining DejaGnu}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_OBTAINING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_OBTAINING}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_INSTALLATION}{\fldrslt Installation}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_INSTALLATION}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_INSTALLATION}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_CONFIGURING}{\fldrslt Configuring DejaGnu}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_CONFIGURING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_CONFIGURING}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_INSTALLING}{\fldrslt Installing DejaGnu}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_INSTALLING}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_INSTALLING}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_BUILTINS}{\fldrslt Builtin Procedures}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_BUILTINS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_BUILTINS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_COREPROCS}{\fldrslt Core Internal Procedures}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_COREPROCS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_COREPROCS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_REMOTEPROCS}{\fldrslt Procedures For Remote Communication}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_REMOTEPROCS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_REMOTEPROCS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_CONNPROCS}{\fldrslt Procedures For Using Utilities to Connect}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_CONNPROCS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_CONNPROCS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_TARGETPROCS}{\fldrslt Procedures For Target Boards}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_TARGETPROCS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_TARGETPROCS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_TARGETDB}{\fldrslt Target Database Procedures}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_TARGETDB}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_TARGETDB}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_PLATFORMPROCS}{\fldrslt Platform Dependant Procedures}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_PLATFORMPROCS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_PLATFORMPROCS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_UTILPROCS}{\fldrslt Utility Procedures}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_UTILPROCS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_UTILPROCS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_LIBGLOSS}{\fldrslt Libgloss, A Free BSP}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_LIBGLOSS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_LIBGLOSS}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_DEBUGPROCS}{\fldrslt Procedures for debugging your Tcl code.}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_DEBUGPROCS}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_DEBUGPROCS}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_FILEMAP}{\fldrslt File Map}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_FILEMAP}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_FILEMAP}{\fldrslt 000}}}}\hyphpar0\par\pard\sb48\li1440\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_UNITTESTAPI}{\fldrslt \b 8. Unit Testing API}}\b \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_UNITTESTAPI}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_UNITTESTAPI}{\fldrslt 000}}}}\keepn\hyphpar0\par\pard\sb48\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_CUNIT}{\fldrslt \b0 C Unit Testing API}}\b0 \tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_CUNIT}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_CUNIT}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_PASSFUNC}{\fldrslt Pass Function}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_PASSFUNC}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_PASSFUNC}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_FAILFUNC}{\fldrslt Fail Function}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_FAILFUNC}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_FAILFUNC}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_UNTESTEDFUNC}{\fldrslt Untested Function}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_UNTESTEDFUNC}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_UNTESTEDFUNC}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_UNRESOLVEDFUNC}{\fldrslt Unresolved Function}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_UNRESOLVEDFUNC}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_UNRESOLVEDFUNC}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_TOTALSFUNC}{\fldrslt Totals Function}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_TOTALSFUNC}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_TOTALSFUNC}{\fldrslt 000}}}}\hyphpar0\par\pard\li1920\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_CPPUNIT}{\fldrslt C++ Unit Testing API}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_CPPUNIT}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_CPPUNIT}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_PASSMETH}{\fldrslt Pass Method}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_PASSMETH}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_PASSMETH}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_FAILMETH}{\fldrslt Fail Method}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_FAILMETH}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_FAILMETH}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_UNTESTEDMETH}{\fldrslt Untested Method}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_UNTESTEDMETH}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_UNTESTEDMETH}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_UNRESOLVEDMETH}{\fldrslt Unresolved Method}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_UNRESOLVEDMETH}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_UNRESOLVEDMETH}{\fldrslt 000}}}}\hyphpar0\par\pard\li2400\sl220\fi-480 {\field{\*\fldinst HYPERLINK \\l ID_TOTALSMETH}{\fldrslt Totals Method}}\tqr\tldot\tx8400\tab {\field{\*\fldinst HYPERLINK \\l ID_TOTALSMETH}{\fldrslt {\field\flddirty{\*\fldinst PAGEREF ID_TOTALSMETH}{\fldrslt 000}}}}\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgnlcrm\pgnrestart\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Abstract}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Abstract}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_PREFACE}{\*\bkmkend ID_PREFACE}\b\fs29\f2 Abstract\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 This document describes the functionality of DejaGnu, the testing framework of the GNU project. DejaGnu is written in Expect, which uses Tcl as a command language. Expect acts as a very programmable shell. As with other Unix command shells, you can run any program, but once the program is started, your test script has programmable control over its input and output. This does not just apply to the programs under test; \b expect\b0 can also run any auxiliary program, such as \b diff\b0 or \b sh\b0 , with full control over its input and output.\hyphpar0\par\pard\sb100\li960\sl220\qj DejaGnu itself is merely a framework for the creation of testsuites. Testsuites are distributed with each application.\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec\pgnrestart\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 1. Overview}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 1. Overview}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_OVERVIEW}{\*\bkmkend ID_OVERVIEW}\b\fs29\f2 Chapter 1. Overview\keepn\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_WHATIS}{\*\bkmkend ID_WHATIS}\fs24 What is DejaGnu ?\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu is a framework for testing other programs. Its purpose is to provide a single front end for all tests. Think of it as a custom library of Tcl procedures crafted to support writing a test harness. A \i Test Harness\i0 is the testing infrastructure that is created to support a specific program or tool. Each program can have multiple testsuites, all supported by a single test harness. DejaGnu is written in Expect, which in turn uses Tcl -- Tool command language. There is more information on Tcl at the Scriptics\up8\fs12 1\up0\fs20 web site and the Expect web site is at NIST\up8\fs12 2\up0\fs20 .\hyphpar0\par\pard\sb100\li960\sl220\qj Julia Menapace first coined the term ``DejaGnu'' to describe an earlier testing framework at Cygnus Support she had written for \b GDB\b0 . When we replaced it with the Expect-based framework, it was like DejaGnu all over again. More importantly, it was also named after my daughter, Deja Snow Savoye\up8\fs12 3\up0\fs20 (now 13 years old as of September 2003), who was a toddler during DejaGnu's beginnings.\hyphpar0\par\pard\sb100\li960\sl220\qj DejaGnu offers several advantages for testing:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 The flexibility and consistency of the DejaGnu framework make it easy to write tests for any program, with either batch oriented, or interactive programs.\hyphpar0\par\pard\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 DejaGnu provides a layer of abstraction which allows you to write tests that are portable to any host or target where a program must be tested. For instance, a test for \b GDB\b0 can run from any supported host system on any supported target system. DejaGnu runs tests on many single board computers, whose operating software ranges from a simple boot monitor to a real-time OS.\hyphpar0\par\pard\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 All tests have the same output format. This makes it easy to integrate testing into other software development processes. DejaGnu's output is designed to be parsed by other filtering script and it is also human readable.\hyphpar0\par\pard\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Using Tcl and Expect, it's easy to create wrappers for existing testsuites. By incorporating existing tests under DejaGnu, it's easier to have a single set of report analyse programs..\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 Running tests requires two things: the testing framework and the testsuites themselves. Tests are usually written in Expect using Tcl, but you can also use a Tcl script to run a testsuite that is not based on Expect. Expect script filenames conventionally use \i .exp\i0 as a suffix; for example, the main implementation of the DejaGnu test driver is in the file runtest.exp.)\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_NEW}{\*\bkmkend ID_NEW}\b\fs24\lang1024\f2 What's New In This Release\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 This release has a number of substantial changes over version 1.3. The most visible change is that the version of Expect and Tcl included in the release are up-to-date with the current stable net releases. The biggest change is years of modifications to the target configuration system, used for cross testing. While this greatly improved cross testing, is has made that subsystem very complicated. The goal is to have this entirely rewritten using iTcl by the next release. Other changes are:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 More built-in support for building target binaries with the correct linker flags. Currently this only works with GCC as the cross compiler, preferably with a target supported by {\field{\*\fldinst HYPERLINK \\l ID_LIBGLOSS}{\fldrslt Libgloss}}.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Lots of little bug fixes from years of heavy use at Cygnus Solutions.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 DejaGnu now uses Automake for Makefile configuration.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Updated documentation, now in SGML (using the free GNU DocBook tools\up8\fs12 4\up0\fs20 ) format.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Windows support. There is beta level support for Windows that is still a work in progress. This requires the Cygwin\up8\fs12 5\up0\fs20 POSIX subsystem for Windows.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_CYGWIN}{\*\bkmkend ID_CYGWIN}\b\fs22\f2 Windows Support\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 To use DejaGnu on Windows, you need to first install the Cygwin\up8\fs12 6\up0\fs20 release. This works as of the B20.1 release. Cygwin is a POSIX system for Windows. This covers both utility programs and a library that adds POSIX system calls to Windows. Among them is pseudo tty support for Windows that emulates the POSIX pty standard. The latest Cygwin is always available from this location\up8\fs12 7\up0\fs20 . This works well enough to run \i "make check"\i0 of the GNU development tree on Windows after a native build. But the nature of ptys on Windows is still evolving. Your mileage may vary.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_DESIGNGOALS}{\*\bkmkend ID_DESIGNGOALS}\b\fs24\lang1024\f2 Design Goals\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu grew out of the internal needs of Cygnus Solutions, the company formerly known as Cygnus Support. Cygnus maintained and enhanced a variety of free programs in many different environments and we needed a testing tool that:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 was useful to developers while fixing bugs;\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 automated running many tests during a software release process;\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 was portable among a variety of host computers;\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 supported cross-development testing;\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 permitted testing interactive programs, like \b GDB\b0 ; and \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 permitted testing batch oriented programs, like \b GCC\b0 .\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 Some of the requirements proved challenging. For example, interactive programs do not lend themselves very well to automated testing. But all the requirements are important: for instance, it is imperative to make sure that \b GDB\b0 works as well when cross-debugging as it does in a native configuration. \hyphpar0\par\pard\sb100\li960\sl220\qj Probably the greatest challenge was testing in a cross-development environment. Most cross-development environments are customized by each developer. Even when buying packaged boards from vendors there are many differences. The communication interfaces vary from a serial line to Ethernet. DejaGnu was designed with a modular communication setup, so that each kind of communication can be added as required and supported thereafter. Once a communication procedure is coded, any test can use it. Currently DejaGnu can use \b rsh\b0 , \b rlogin\b0 , \b telnet\b0 , \b tip\b0 , \b kermit\b0 and \b mondfe\b0 for remote communications.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_POSIX}{\*\bkmkend ID_POSIX}\b\fs24\lang1024\f2 A POSIX conforming test framework\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu conforms to the POSIX 1003.3 standard for test frameworks. Rob Savoye was a member of that committee.\hyphpar0\par\pard\sb100\li960\sl220\qj The POSIX standard 1003.3 defines what a testing framework needs to provide, in order to permit the creation of POSIX conformance test suites. This standard is primarily oriented to running POSIX conformance tests, but its requirements also support testing of features not related to POSIX conformance. POSIX 1003.3 does not specify a particular testing framework, but at this time there is only one other POSIX conforming test framework: TET. TET was created by Unisoft for a consortium comprised of X/Open, Unix International and the Open Software Foundation.\hyphpar0\par\pard\sb100\li960\sl220\qj The POSIX documentation refers to \i assertions\i0 . An assertion is a description of behavior. For example, if a standard says ``The sun shall shine'', a corresponding assertion might be ``The sun is shining.'' A test based on this assertion would pass or fail depending on whether it is day or night. It is important to note that the standard being tested is never 1003.3; the standard being tested is some other standard, for which the assertions were written.\hyphpar0\par\pard\sb100\li960\sl220\qj As there is no testsuite to test testing frameworks for POSIX 1003.3 conformance, verifying conformance to this standard is done by repeatedly reading the standard and experimenting. One of the main things 1003.3 does specify is the set of allowed output messages and their definitions. Four messages are supported for a required feature of POSIX conforming systems and a fifth for a conditional feature. DejaGnu supports the use of all five output messages. In this sense a testsuite that uses exactly these messages can be considered POSIX conforming. These definitions specify the output of a test case:\hyphpar0\par\pard\sb200\sl220\qj \lang1024 PASS\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A test has succeeded. That is, it demonstrated that the assertion is true.\hyphpar0\par\pard\sb200\sl220\qj XFAIL\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab POSIX 1003.3 does not incorporate the notion of expected failures, so \i PASS\i0 , instead of \i XPASS\i0 , must also be returned for test cases which were expected to fail and did not. This means that \i PASS\i0 is in some sense more ambiguous than if \i XPASS\i0 is also used.\hyphpar0\par\pard\sb200\sl220\qj FAIL\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A test has produced the bug it was intended to capture. That is, it has demonstrated that the assertion is false. The \i FAIL\i0 message is based on the test case only. Other messages are used to indicate a failure of the framework. As with \i PASS\i0 , POSIX tests must return \i FAIL\i0 rather than \i XFAIL\i0 even if a failure was expected.\hyphpar0\par\pard\sb200\sl220\qj UNRESOLVED\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A test produced indeterminate results. Usually, this means the test executed in an unexpected fashion; this outcome requires that a human being go over results, to determine if the test should have passed or failed. This message is also used for any test that requires human intervention because it is beyond the abilities of the testing framework. Any unresolved test should resolved to \i PASS\i0 or \i FAIL\i0 before a test run can be considered finished.\hyphpar0\par\pard\sb100\li1360\sl220\qj \lang1033 Note that for POSIX, each assertion must produce a test result code. If the test isn't actually run, it must produce \i UNRESOLVED\i0 rather than just leaving that test out of the output. This means that you have to be careful when writing tests to not carelessly use Tcl commands like \i return\i0 ---if you alter the flow of control of the Tcl code you must insure that every test still produces some result code.\hyphpar0\par\pard\sb100\li1360\sl220\qj Here are some of the ways a test may wind up \i UNRESOLVED\i0 :\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 A test's execution is interrupted.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 A test does not produce a clear result. This is usually because there was an \i ERROR\i0 from DejaGnu while processing the test, or because there were three or more \i WARNING\i0 messages. Any \i WARNING\i0 or \i ERROR\i0 messages can invalidate the output of the test. This usually requires a human being to examine the output to determine what really happened---and to improve the test case.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 A test depends on a previous test, which fails.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 The test was set up incorrectly.\hyphpar0\par\pard\sb200\sl220\qj UNTESTED\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A test was not run. This is a place-holder, used when there is no real test case yet.\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 The only remaining output message left is intended to test features that are specified by the applicable POSIX standard as conditional:\hyphpar0\par\pard\sb200\sl220\qj \lang1024 UNSUPPORTED\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab There is no support for the tested case. This may mean that a conditional feature of an operating system, or of a compiler, is not implemented. DejaGnu also uses this message when a testing environment (often a ``bare board'' target) lacks basic support for compiling or running the test case. For example, a test for the system subroutine \i gethostname\i0 would never work on a target board running only a boot monitor.\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 DejaGnu uses the same output procedures to produce these messages for all testsuites and these procedures are already known to conform to POSIX 1003.3. For a DejaGnu testsuite to conform to POSIX 1003.3, you must avoid the \i setup\i0 xfail\} procedure as described in the \i PASS\i0 section above and you must be careful to return \i UNRESOLVED\i0 where appropriate, as described in the \i UNRESOLVED\i0 section above.\hyphpar0\par\pard\sb200\sl293 \b\fs26\lang1024\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://www.scriptics.com\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 2. \tab http://expect.nist.gov\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 3. \tab mailto:deja@welcomehome.org\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 4. \tab http://nis-www.lanl.gov/~rosalia/mydocs/docbook-intro.html\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 5. \tab http://www.cygwin.com/\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 6. \tab http://www.cygwin.com/\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 7. \tab http://www.cygwin.com/\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 2. Getting DejaGnu up and running}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 2. Getting DejaGnu up and running}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_GETTINGUP}{\*\bkmkend ID_GETTINGUP}\b\fs29\f2 Chapter 2. Getting DejaGnu up and running\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 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.\hyphpar0\par\pard\sb100\li960\sl220\qj 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.\hyphpar0\par\pard\sb100\li960\sl220\qj 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) \hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\f3 apt-get dejagnu\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 . These examples were run on a primary machine with a AMD K6 and a Mac Powerbook G3 serving as a remote target.\hyphpar0\par\pard\sb100\li960\sl220\qj 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.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart _209}{\*\bkmkend _209}\b\fs24\lang1024\f2 Test your installation\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 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\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 dgt:~$ mkdir ~/dejagnu.test\sa0\par\fi0\sb0
dgt:~$ cd ~/dejagnu.test\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Now you are ready to test DejaGnu's main program called runtest. The expecteted output is shown\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-1. Runtest output in a empty directory\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt:~/dejagnu.test$ runtest\sa0\par\fi0\sb0
WARNING: Couldn't find the global config file.\sa0\par\fi0\sb0
WARNING: No tool specified Test\sa0\par\fi0\sb0
Run By dgt on Sun Nov 25 17:07:03 2001 Native configuration is i586-pc-linux-gnu\sa0\par\fi0\sb0
=== tests ===\sa0\par\fi0\sb0
Schedule of variations: unix\sa0\par\fi0\sb0
Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.\sa0\par\fi0\sb0
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.\sa0\par\fi0\sb0
ERROR: Couldn't find tool config file for unix.\sa0\par\fi0\sb0
=== Summary ===\hyphpar0\par\pard\sb100\li960\sl220\qj \fs20\lang1033\f1 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.\hyphpar0\par\pard\sb100\li960\sl198\qj \fs18\lang1024\f3 :~/dejagnu.test$ rm testrun.sum testrun.log\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _219}{\*\bkmkend _219}\b\fs22\f2 Windows\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 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.\hyphpar0\par\pard\sb100\li960\sl220\qj 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/.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _223}{\*\bkmkend _223}\b\fs22\lang1024\f2 Getting the source code for the calc example\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 If you are running a Debian distribution you can find the examples under /usr/share/doc/dejagnu/examples. These examples seem to be missing in Red Hat's RPM. In this case download the sources of DejaGnu and adjust the pathes to the DejaGnu examples accordingly.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart _226}{\*\bkmkend _226}\b\fs24\lang1024\f2 Create a minimal project, e.g. calc\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 In this section you will to start a small project, using the sample application calc, which is part of your DejaGnu distribution\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _229}{\*\bkmkend _229}\b\fs22\lang1024\f2 A simple project without the GNU autotools\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 The runtest program can be run standalone. All the autoconf/automake support is just cause those programs are commonly used for other GNU applications. The key to running runtest standalone is having the local site.exp file setup correctly, which automake does.\hyphpar0\par\pard\sb100\li960\sl220\qj The generated site.exp should like like:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 set tool calc\sa0\par\fi0\sb0
set srcdir .\sa0\par\fi0\sb0
set objdir /home/dgt/dejagnu.test\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _234}{\*\bkmkend _234}\b\fs22\f2 Using autoconf/autoheader/automake\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 We have to prepare some input file in order to run autocon and automake. There is book \'93GNU autoconf, automake and libtool\'94 by Garry V. Vaughan, et al. NewRider, ISBN 1-57870-190-2 which describes this process thoroughly.\hyphpar0\par\pard\sb100\li960\sl220\qj From the calc example distributed with the DejaGnu documentation you should copy the program file itself (calc.c) and some additional files, which you might examine a little bit close to derive their meanings.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 dgt:~/dejagnu.test$ cp -r /usr/share/doc/dejagnu/examples/calc/\\\sa0\par\fi0\sb0
\{configure.in,Makefile.am,calc.c,testsuite\} .\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 In Makemake.am note the presence of the AUTOMAKE_OPTIONS = dejagnu. This option is needed.\hyphpar0\par\pard\sb100\li960\sl220\qj Run aclocal to generate aclocal.m4, which is a collection of macros needed by configure.in\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 dgt:~/dejagnu.test$ aclocal\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 autoconf is another part of the auto-tools. Run it to generate configure based on information contained in configure.in.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 dgt:~/dejagnu.test$ autoconf\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 autoheader is another part of the auto-tools. Run it to generate calc.h.in. \hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 dgt:~/dejagnu.test$ autoheader\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 The Makefile.am of this example was developed as port of the DejaGnu distribution. Adapt Makefile.am for this test. Replace the line \'93#noinst_PROGRAMS = calc\'94 to \'93bin_PROGRAMS = calc\'94. Change the RUNTESTDEFAULTFLAGS from \'93$$srcdir/testsuite\'94 to \'93./testsuite\'94.\hyphpar0\par\pard\sb100\li960\sl220\qj Running automake at this point contains a series of warning in its output as shown in the following example:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-2. Sample output of automake with missing files\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt:~/dejagnu.test$ automake --add-missing\sa0\par\fi0\sb0
automake: configure.in: installing `./install-sh'\sa0\par\fi0\sb0
automake: configure.in: installing `./mkinstalldirs'\sa0\par\fi0\sb0
automake: configure.in: installing `./missing'\sa0\par\fi0\sb0
automake: Makefile.am: installing `./INSTALL'\sa0\par\fi0\sb0
automake: Makefile.am: required file `./NEWS' not found\sa0\par\fi0\sb0
automake: Makefile.am: required file `./README' not found\sa0\par\fi0\sb0
automake: Makefile.am: installing `./COPYING'\sa0\par\fi0\sb0
automake: Makefile.am: required file `./AUTHORS' not found\sa0\par\fi0\sb0
automake: Makefile.am: required file `./ChangeLog' not found\sa0\par\fi0\sb0
configure.in: 4: required file `./calc.h.in' not found\sa0\par\fi0\sb0
Makefile.am:6: required directory ./doc does not exist\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Create a empty directory doc and empty files INSTALL, NEWS, README, AUTHORS, ChangeLog and COPYING. The default COPYING will point to the GNU Public License (GPL). In a real project it would be time to add some meaningfull text in each file.\hyphpar0\par\pard\sb100\li960\sl220\qj Adapt calc to your environment by calling configure.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-3. Sample output of configure\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt:~/dejagnu.test$ ./configure\sa0\par\fi0\sb0
creating cache ./config.cache\sa0\par\fi0\sb0
checking whether to enable maintainer-specific portions of Makefiles... no\sa0\par\fi0\sb0
checking for a BSD compatible install... /usr/bin/install -c\sa0\par\fi0\sb0
checking whether build environment is sane... yes\sa0\par\fi0\sb0
checking whether make sets $\{MAKE\}... yes\sa0\par\fi0\sb0
checking for working aclocal... found\sa0\par\fi0\sb0
checking for working autoconf... found\sa0\par\fi0\sb0
checking for working automake... found\sa0\par\fi0\sb0
checking for working autoheader... found\sa0\par\fi0\sb0
checking for working makeinfo... found\sa0\par\fi0\sb0
checking for gcc... gcc checking whether the C compiler (gcc ) works... yes\sa0\par\fi0\sb0
checking whether the C compiler (gcc ) is a cross-compiler... no\sa0\par\fi0\sb0
checking whether we are using GNU C... yes\sa0\par\fi0\sb0
checking whether gcc accepts -g... yes\sa0\par\fi0\sb0
checking for a BSD compatible install... /usr/bin/install -c\sa0\par\fi0\sb0
checking how to run the C preprocessor... gcc -E\sa0\par\fi0\sb0
checking for stdlib.h... yes\sa0\par\fi0\sb0
checking for strcmp... yes\sa0\par\fi0\sb0
updating cache ./config.cache\sa0\par\fi0\sb0
creating ./config.status\sa0\par\fi0\sb0
creating Makefile creating calc.h\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 If you are familiar with GNU software, this output should not contain any surprise to you. Any errors should be easy to fix for such a simple program.\hyphpar0\par\pard\sb100\li960\sl220\qj Build the calc executable:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-4. Sample output building calc\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt:~/dejagnu.test$ make\sa0\par\fi0\sb0
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c calc.c\sa0\par\fi0\sb0
gcc -g -O2 -o calc calc.o\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 You prepared a few files and then called some commands. Respecting the right order assures a automatic and correctly compiled calc program. The following example resumes the correct order.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-5. Creating the calc program using the GNU autotools\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt:~/dejagnu.test$ aclocal\sa0\par\fi0\sb0
dgt:~/dejagnu.test$ autoconf\sa0\par\fi0\sb0
dgt:~/dejagnu.test$ autoheader\sa0\par\fi0\sb0
dgt:~/dejagnu.test$ automake --add-missing\sa0\par\fi0\sb0
dgt:~/dejagnu.test$ ./configure\sa0\par\fi0\sb0
dgt:~/dejagnu.test$ make\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Play with calc and verify whether it works correctly. A sample session might look like this:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 dgt:~/dejagnu.test$ ./calc\sa0\par\fi0\sb0
calc: version\sa0\par\fi0\sb0
Version: 1.1\sa0\par\fi0\sb0
calc:\i \i0 add 3 4\sa0\par\fi0\sb0
7\sa0\par\fi0\sb0
calc: multiply 3 4\i \i0 \sa0\par\fi0\sb0
12\sa0\par\fi0\sb0
calc: multiply 2 4\i \i0 \sa0\par\fi0\sb0
12\sa0\par\fi0\sb0
calc: quit\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Look at the intentional bug that 2 times 4 equals 12.\hyphpar0\par\pard\sb100\li960\sl220\qj The tests run by DejaGnu need a file called site.exp, which is automatically generated if we call \'93make site.exp\'94. This was the purpose of the \'93AUTOMAKE_OPTIONS = dejagnu\'94 in Makefile.am.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-6. Sample output generating a site.exp\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt: make site.exp\sa0\par\fi0\sb0
dgt:~/dejagnu.test$ make site.exp\sa0\par\fi0\sb0
Making a new site.exp file...\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart _275}{\*\bkmkend _275}\b\fs24\f2 Our first automated tests\keepn\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _277}{\*\bkmkend _277}\fs22 Running the test for the calc example\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 Now we are ready to call the automated tests \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-7. Sample output of runtest in a configured directory\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt:~/dejagnu.test$ make check\sa0\par\fi0\sb0
make check-DEJAGNU\sa0\par\fi0\sb0
make[1]: Entering directory `/home/dgt/dejagnu.test' srcdir=`cd . && pwd`; export srcdir; \\\sa0\par\fi0\sb0
EXPECT=expect; export EXPECT; \\ runtest=runtest; \\\sa0\par\fi0\sb0
if /bin/sh -c "$runtest --version" > /dev/null 2>&1; then \\\sa0\par\fi0\sb0
$runtest --tool calc CALC=`pwd`/calc --srcdir ./testsuite ; \\\sa0\par\fi0\sb0
else echo "WARNING: could not find \\`runtest'" 1>&2; :;\\\sa0\par\fi0\sb0
fi\sa0\par\fi0\sb0
WARNING: Couldn't find the global config file.\sa0\par\fi0\sb0
WARNING: Couldn't find tool init file\sa0\par\fi0\sb0
Test Run By dgt on Sun Nov 25 21:42:21 2001\sa0\par\fi0\sb0
Native configuration is i586-pc-linux-gnu\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
=== calc tests ===\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
Schedule of variations:\sa0\par\fi0\sb0
unix\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
Running target unix\sa0\par\fi0\sb0
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.\sa0\par\fi0\sb0
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.\sa0\par\fi0\sb0
Using ./testsuite/config/unix.exp as tool-and-target-specific interface file.\sa0\par\fi0\sb0
Running ./testsuite/calc.test/calc.exp ...\sa0\par\fi0\sb0
FAIL: multiply2 (bad match)\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
=== calc Summary ===\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# of expected passes 5\sa0\par\fi0\sb0
# of unexpected failures 1\sa0\par\fi0\sb0
/home/Dgt/dejagnu.test/calc version Version: 1.1\sa0\par\fi0\sb0
make[1]: *** [check-DEJAGNU] Fehler 1\sa0\par\fi0\sb0
make[1]: Leaving directory `/home/Dgt/dejagnu.test' make: *** [check-am] Fehler 2\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Did you see the line \'93FAIL:\'93? 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.\hyphpar0\par\pard\sb100\li960\sl220\qj Examine the output files calc.sum and calc.log. Try to understand the testcases written in ~/dejagnu.test/testsuite/calc.test/calc.exp. To understand Expect you might take a look at the book "Exploring Expect", which is an excellent resource for learning and using Expect. (Pub: O'Reilly, ISBN 1-56592-090-2) The book contains hundreds of examples and also includes a tutorial on Tcl. Exploring Expect is 602 pages long.\~\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _285}{\*\bkmkend _285}\b\fs22\lang1024\f2 The various config files or how to avoid warnings\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu may be customized by each user. It first searches for a file called ~/.dejagnurc. Create the file ~/.dejagnurc and insert the following line:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 puts "I am ~/.dejagnurc"\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Rerun make check. Test whether the output contains "I am ~/.dejagnurc". Create ~/my_dejagnu.exp and insert the following line:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 puts "I am ~/my_dejagnu.exp"\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 In a Bash-Shell enter\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 dgt:~/dejagnu.test$ export DEJAGNU=~/my_dejagnu.exp\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Run \'93make check\'94 again. The output should not contain \'93WARNING: Couldn't find the global config file.\'94. Create the sub-directory lib. Create the file \'93calc.exp\'94 in it and insert the following line:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 puts "I am lib/calc.exp"\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 The last warning \'93WARNING: Couldn't find tool init file\'94 should not be part of the output of make check. Create the directory \'98/boards. Create the file \'98/boards/standard.exp and insert the following line:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 puts "I am boards/standard.exp"\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 If the variable DEJAGNU is still not empty then the (abbreviated) output of \'93make check\'94 should look like this:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-8. Sample output of runtest with the usual configuration files\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt:~/dejagnu.test$ make check\sa0\par\fi0\sb0
<...>\sa0\par\fi0\sb0
fi\sa0\par\fi0\sb0
I am ~/.dejagnurc\sa0\par\fi0\sb0
I am ~/my_dejagnu.exp\sa0\par\fi0\sb0
I am lib/calc.exp\sa0\par\fi0\sb0
Test Run By dgt on Sun Nov 25 22:19:14 2001\sa0\par\fi0\sb0
Native configuration is i586-pc-linux-gnu\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
=== calc tests ===\sa0\par\fi0\sb0
Using /home/Dgt/boards/standard.exp as standard board description\\\sa0\par\fi0\sb0
file for build.\sa0\par\fi0\sb0
I am ~/boards/standard.exp\sa0\par\fi0\sb0
Using /home/Dgt/boards/standard.exp as standard board description\\\sa0\par\fi0\sb0
file for host.\sa0\par\fi0\sb0
I am ~/boards/standard.exp\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
Schedule of variations:\sa0\par\fi0\sb0
unix\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
Running target unix\sa0\par\fi0\sb0
Using /home/Dgt/boards/standard.exp as standard board description\\\sa0\par\fi0\sb0
file for target.\sa0\par\fi0\sb0
I am ~/boards/standard.exp\sa0\par\fi0\sb0
Using /usr/share/dejagnu/baseboards/unix.exp as board description file\\\sa0\par\fi0\sb0
for target.\sa0\par\fi0\sb0
<...>\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 It is up to you to decide when and where to use any of the above mentioned config files for customizing. This chapters showed you where and in which order the different config files are run.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _302}{\*\bkmkend _302}\b\fs22\lang1024\f2 When trouble strikes\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 Calling runtest with the '-v'-flag shows you in even more details which files are searched in which order. Passing it several times gives more and more details. \hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-9. Displaying details about runtest execution\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 runtest -v -v -v --tool calc CALC=`pwd`/calc --srcdir ./testsuite\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Calling runtest with the '--debug'-flag logs a lot of details to dbg.log where you can analyse it afterwards. \hyphpar0\par\pard\sb100\li960\sl220\qj In all test cases you can temporary adjust the verbosity of information by adding the following Tcl-command to any tcl file that gets loaded by dejagnu, for instance, ~/.dejagnurc:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 set verbose 9\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _311}{\*\bkmkend _311}\b\fs22\f2 Testing \'93Hello world\'94 locally\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This test checks, whether the built-in shell command \'93echo Hello world\'94 will really write \'93Hello world\'94 on the console. Create the file ~/dejagnu.test/testsuite/calc.test/local_echo.exp. It should contain the following lines\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-10. A first (local) test case\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 set test "Local Hello World"\sa0\par\fi0\sb0
send "echo Hello World"\sa0\par\fi0\sb0
expect \{\sa0\par\fi0\sb0
-re "Hello World" \{ pass "$test" \}\sa0\par\fi0\sb0
\}\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Run runtest again and verify the output \'93calc.log\'94\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart _318}{\*\bkmkend _318}\b\fs24\lang1024\f2 A first remote test\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Testing remote targets is a lot trickier especially if you are using an embedded target which has no built in support for things like a compiler, ftp server or a Bash-shell. Before you can test calc on a remote target you have to acquire a few basics skills.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _321}{\*\bkmkend _321}\b\fs22\lang1024\f2 Setup telnet to your own host\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 The easiest remote host is usually the host you are working on. In this example we will use telnet to login in your own workstation. For security reason you should never have a telnet deamon running on machine connected on the internet, as password and usernames are transmitted in clear text. We assume you know how to setup your machine for a telnet daemon.\hyphpar0\par\pard\sb100\li960\sl220\qj Next try whether you may login in your own host by issuing the command \'93telnet localhost.1\'94. In order to be able to distinguish between a normal session an a telnet login add the following lines to /home/dgt/.bashrc.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 if [ "$REMOTEHOST" ]\sa0\par\fi0\sb0
then\sa0\par\fi0\sb0
PS1='remote:\\w\\$ '\sa0\par\fi0\sb0
fi\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Now on the machine a \'93remote\'94 login looks like this:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-11. Sample log of a telnet login to localhost\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 dgt:~/dejagnu.test$ telnet localhost\sa0\par\fi0\sb0
Trying 127.0.0.1...\sa0\par\fi0\sb0
Connected to 127.0.0.1.\sa0\par\fi0\sb0
Escape character is '^]'.\sa0\par\fi0\sb0
Debian GNU/Linux testing/unstable Linux\sa0\par\fi0\sb0
K6Linux login: dgt\sa0\par\fi0\sb0
Password:\sa0\par\fi0\sb0
Last login: Sun Nov 25 22:46:34 2001 from localhost on pts/4\sa0\par\fi0\sb0
Linux K6Linux 2.4.14 #1 Fre Nov 16 19:28:25 CET 2001 i586 unknown\sa0\par\fi0\sb0
No mail.\sa0\par\fi0\sb0
remote:~$ exit\sa0\par\fi0\sb0
logout\sa0\par\fi0\sb0
Connection closed by foreign host.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _330}{\*\bkmkend _330}\b\fs22\f2 A test case for login via telnet\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 In order to define a correct setup we have add a line containing \'93set target unix\'94 either to ~/.dejagnurc or to ~/my_dejagnu.exp. In ~/boards/standard.exp add the following four lines to define a few patterns for the DejaGnu telnet login procedure.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-12. Defining a remote target board\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 set_board_info shell_prompt "remote:"\sa0\par\fi0\sb0
set_board_info telnet_username "dgt"\sa0\par\fi0\sb0
set_board_info telnet_password "top_secret"\sa0\par\fi0\sb0
set_board_info hostname "localhost"\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 As DejaGnu will be parsing the telnet session output for some well known pattern the output there are a lot of things that can go wrong. If you have any problems verify your setup:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Is \fs18\f3 /etc/motd\fs20\f1 empty?\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Is \fs18\f3 /etc/issue.net\fs20\f1 empty?\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Exists a empty \fs18\f3 ~/.hushlogin\fs20\f1 ?\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 The LANG environment variable must be either empty or set to \'93C\'94. \hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 To test the login via telnet write a sample test case. Create the file ~/dejagnu.test/testsuite/calc.test/remote_echo.exp and add the following few lines:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-13. DejaGnu script for logging in into a remote target\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 puts "this is remote_echo.exp target for $target "\sa0\par\fi0\sb0
target_info $target\sa0\par\fi0\sb0
#set verbose 9\sa0\par\fi0\sb0
set shell_id [remote_open $target]\sa0\par\fi0\sb0
set test "Remote login to $target"\sa0\par\fi0\sb0
#set verbose 0\sa0\par\fi0\sb0
puts "Spawn id for remote shell is $shell_id"\sa0\par\fi0\sb0
if \{ $shell_id > 0 \} \{\sa0\par\fi0\sb0
pass "$test"\sa0\par\fi0\sb0
\} else \{\sa0\par\fi0\sb0
fail "Remote open to $target"\sa0\par\fi0\sb0
\}\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 In the runtest output you should find something like:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 Running ./testsuite/calc.test/local_echo.exp ...\sa0\par\fi0\sb0
Running ./testsuite/calc.test/remote_echoo.exp ...\sa0\par\fi0\sb0
this is remote_echo.exp target is unix\sa0\par\fi0\sb0
Spawn id for remote shell is exp7\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Have again a look at calc.log to get a feeling how DejaGnu and expect parse the input. \hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _356}{\*\bkmkend _356}\b\fs22\lang1024\f2 Remote testing \'93Hello world\'94\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 Next you will transform the above \'93hello world\'94 example to its remote equivalent. This can be done by adding the following lines to our file remote_echo.exp.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-14. A first (local) remote "Hello world" test\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 set test "Remote_send Hello World"\sa0\par\fi0\sb0
set status [remote_send $target "echo \\"Hello\\" \\"World\\"\\n" ]\sa0\par\fi0\sb0
pass "$test"\sa0\par\fi0\sb0
set test "Remote_expect Hello World"\sa0\par\fi0\sb0
remote_expect $target 5 \{\sa0\par\fi0\sb0
-re "Hello World" \{ pass "$test" \}\sa0\par\fi0\sb0
\}\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Call make check. The output should contain \'93# of expected passes 9\'94 and \'93# of unexcpected failures 1\'94.\hyphpar0\par\pard\sb100\li960\sl220\qj Have a look at the procedures in /usr/share/dejagnu/remote.exp to have an overview of the offered procedures and their features. \hyphpar0\par\pard\sb100\li960\sl220\qj Now setup a real target. In the following example we assume as target a PowerBook running Debian. As above add a test user "dgt", install telnet and FTP servers. In order to distinguish it from the host add the line \hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\f3 PS1='test:>'\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 to /home/dgt/.bash_profile. Also add a corresponding entry "powerbook" to /etc/hosts and verify that you are able to ping, telnet and ftp to the target "powerbook".\hyphpar0\par\pard\sb100\li960\sl220\qj In order to let runtest run its test on the "powerbook" target change the following lines in ~/boards/standard.exp:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-15. Board definition for a remote target\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 set_board_info protocol "telnet"\sa0\par\fi0\sb0
set_board_info telnet_username "dgt"\sa0\par\fi0\sb0
set_board_info telnet_password "top_secret"\sa0\par\fi0\sb0
set_board_info shell_prompt "test:> "\sa0\par\fi0\sb0
set_board_info hostname "powerbook"\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Now call runtest again with the same arguments and verify whether all went okay by taking a close look at calc.log.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _371}{\*\bkmkend _371}\b\fs22\lang1024\f2 Transferring files from/to the target\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 A simple procedure like this will do the job for you:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-16. Test script to transfer a file to a remote target\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 set test "Remote_download"\sa0\par\fi0\sb0
puts "Running Remote_download"\sa0\par\fi0\sb0
# set verbose 9\sa0\par\fi0\sb0
set remfile /home/dgt/dejagnu2\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
set status [remote_download $target /home/dgt/.dejagnurc $remfile]\sa0\par\fi0\sb0
if \{ "$status" == "" \} \{\sa0\par\fi0\sb0
fail "Remote download to $remfile on $target"\sa0\par\fi0\sb0
\} else \{\sa0\par\fi0\sb0
pass "$test"\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
puts "status of remote_download ist $status"\sa0\par\fi0\sb0
# set verbose 0\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 After running runtest again, check whether the file dejagnu2 exists on the target. This example will only work if the rcp command works with your target. If you have a working FTP-server on the target you can use it by adding the following lines to ~/boards/standard.exp:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-17. Defining a board to use FTP as file transport\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 set_board_info file_transfer "ftp"\sa0\par\fi0\sb0
set_board_info ftp_username "dgt"\sa0\par\fi0\sb0
set_board_info ftp_password "1234"\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _381}{\*\bkmkend _381}\b\fs22\f2 Preparing for crosscompilation\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 For crosscompiling you need working binutils, gcc and a base library like libc or glib for your target. It is beyond the scope of this document to describe how to get it working. The following examples assume a cross compiler for PowerPC which is called linux-powerpc-gcc.\hyphpar0\par\pard\sb100\li960\sl220\qj Add AC_CANONICAL_TARGET in dejagnu.test/configure.in at the following location. Copy config.guess from /usr/share/automake to dejagnu.test.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 AM_CONFIG_HEADER(calc.h)\sa0\par\fi0\sb0
AC_CANONICAL_TARGET([])\sa0\par\fi0\sb0
AM_INIT_AUTOMAKE(calc, 1.1)\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 You need to run automake 2.5 or later. Depending on your installation calling autoconf2.5 instead of autoconf is not needed. The sequence to regenerate all files is:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 2-18. Using autotools for cross development\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 $ autoconf2.5\sa0\par\fi0\sb0
$ autoheader\sa0\par\fi0\sb0
$ automake\sa0\par\fi0\sb0
$ ./configure --host=powerpc-linux --target=powerpc-linux\sa0\par\fi0\sb0
configure: WARNING: If you wanted to set the --build type, don't use --host.\sa0\par\fi0\sb0
If a cross compiler is detected then cross compile mode will be used.\sa0\par\fi0\sb0
checking build system type... ./config.guess: ./config.guess: No such file or directory\sa0\par\fi0\sb0
configure: error: cannot guess build type; you must specify one\sa0\par\fi0\sb0
$ cp /usr/share/automake/config.guess .\sa0\par\fi0\sb0
$ ./configure --host=powerpc-linux --target=powerpc-linux\sa0\par\fi0\sb0
configure: WARNING: If you wanted to set the --build type, don't use --host.\sa0\par\fi0\sb0
If a cross compiler is detected then cross compile mode will be used. \\\sa0\par\fi0\sb0
checking build system type... i586-pc-linux-gnu\sa0\par\fi0\sb0
checking host system type... powerpc-unknown-linux-gnu\sa0\par\fi0\sb0
<...>\sa0\par\fi0\sb0
checking whether we are cross compiling... yes\sa0\par\fi0\sb0
<...>\sa0\par\fi0\sb0
Configuration:\sa0\par\fi0\sb0
Source code location: .\sa0\par\fi0\sb0
C Compiler: powerpc-linux-gcc\sa0\par\fi0\sb0
C Compiler flags: -g -O2\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Everything should be ready to recompile for the target:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 $ make\sa0\par\fi0\sb0
powerpc-linux-gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c calc.c\sa0\par\fi0\sb0
powerpc-linux-gcc -g -O2 -o calc calc.o\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _392}{\*\bkmkend _392}\b\fs22\f2 Remote testing of calc\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 Not yet written, as I have problem getting libc6-dev-powerpc to work. Probably I first have to build my cross compiler. \hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart _395}{\*\bkmkend _395}\b\fs22\lang1024\f2 Using Windows as host and vxWorks as target\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 A more thorough walk-through will be written in a few weeks.\hyphpar0\par\pard\sb100\li960\sl220\qj In order to test the vxWorks as a target I changed boards/standards.exp to reflect my settings (IP, username, password). Then I reconfigured vxWorks to include a FTP and telnet server (using the same username/password combination ad in boards/standard.exp).\hyphpar0\par\pard\sb100\li960\sl220\qj With this setup and some minor modification (e.g. replacing echo by printf) in my test cases I could test my vxWorks system. It sure does not seem to be a correct setup by DejaGnu standard. For instance, it still loading /usr/share/dejagnu/baseboards/unix.exp instead of vxWorks. In any case I found that (at least under Windows) I did not find out how the command line would let me override settings in my personal config files.\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 3. Running Tests}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 3. Running Tests}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_RUNNINGTESTS}{\*\bkmkend ID_RUNNINGTESTS}\b\fs29\f2 Chapter 3. Running Tests\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 There are two ways to execute a testsuite. The most common way is when there is existing support in the \fs18\f3 Makefile\fs20\f1 . This support consists of a \i check\i0 target. The other way is to execute the \b runtest\b0 program directly. To run \b runtest\b0 directcly from the command line requires either all the correct options, or the {\field{\*\fldinst HYPERLINK \\l ID_LOCAL}{\fldrslt Local Config File}} must be setup correctly.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_MAKECHECK}{\*\bkmkend ID_MAKECHECK}\b\fs24\lang1024\f2 Make check\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 To run tests from an existing collection, first use \b configure\b0 as usual to set up the build directory. Then try typing:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 make check\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 If the \i check\i0 target exists, it usually saves you some trouble. For instance, it can set up any auxiliary programs or other files needed by the tests. The most common file the check builds is the \i site.exp\i0 . The site.exp file contains various variables that DejaGnu used to dertermine the configuration of the program being tested. This is mostly for supporting remote testing.\hyphpar0\par\pard\sb100\li960\sl220\qj The \i check\i0 target is supported by GNU Automake. To have DejaGnu support added to your generated \fs18\f3 Makefile.in\fs20\f1 , just add the keyword dejagnu to the AUTOMAKE_OPTIONS variable in your \fs18\f3 Makefile.am\fs20\f1 file.\hyphpar0\par\pard\sb100\li960\sl220\qj Once you have run \i make check\i0 to build any auxiliary files, you can invoke the test driver \b runtest\b0 directly to repeat the tests. You will also have to execute \b runtest\b0 directly for test collections with no \i check\i0 target in the \fs18\f3 Makefile\fs20\f1 .\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_RUNTEST}{\*\bkmkend ID_RUNTEST}\b\fs24\lang1024\f2 Runtest\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \fs20\lang1033\f1 runtest\b0 is the executable test driver for DejaGnu. You can specify two kinds of things on the \b runtest\b0 command line: command line options, and Tcl variables for the test scripts. The options are listed alphabetically below.\hyphpar0\par\pard\sb100\li960\sl220\qj \b runtest\b0 returns an exit code of \i 1\i0 if any test has an unexpected result; otherwise (if all tests pass or fail as expected) it returns \i 0\i0 as the exit code.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_OUTPUTS}{\*\bkmkend ID_OUTPUTS}\b\fs22\lang1024\f2 Output States\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs18\lang1033\f3 runtest\fs20\f1 flags the outcome of each test as one of these cases. {\field{\*\fldinst HYPERLINK \\l ID_POSIX}{\fldrslt A POSIX Conforming Test Framework}} for a discussion of how POSIX specifies the meanings of these cases.\hyphpar0\par\pard\sb200\sl220\qj \lang1024 PASS\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The most desirable outcome: the test succeeded, and was expected to succeed.\hyphpar0\par\pard\sb200\sl220\qj XPASS\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A pleasant kind of failure: a test was expected to fail, but succeeded. This may indicate progress; inspect the test case to determine whether you should amend it to stop expecting failure.\hyphpar0\par\pard\sb200\sl220\qj FAIL\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A test failed, although it was expected to succeed. This may indicate regress; inspect the test case and the failing software to ocate the bug.\hyphpar0\par\pard\sb200\sl220\qj XFAIL\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A test failed, but it was expected to fail. This result indicates no change in a known bug. If a test fails because the operating system where the test runs lacks some facility required by the test, the outcome is \i UNSUPPORTED\i0 instead.\hyphpar0\par\pard\sb200\sl220\qj UNRESOLVED\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Output from a test requires manual inspection; the testsuite could not automatically determine the outcome. For example, your tests can report this outcome is when a test does not complete as expected.\hyphpar0\par\pard\sb200\sl220\qj UNTESTED\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A test case is not yet complete, and in particular cannot yet produce a \i PASS\i0 or \i FAIL\i0 . You can also use this outcome in dummy ``tests'' that note explicitly the absence of a real test case for a particular property.\hyphpar0\par\pard\sb200\sl220\qj UNSUPPORTED\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab A test depends on a conditionally available feature that does not exist (in the configured testing environment). For example, you can use this outcome to report on a test case that does not work on a particular target because its operating system support does not include a required subroutine.\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 runtest may also display the following messages:\hyphpar0\par\pard\sb200\sl220\qj \lang1024 ERROR\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Indicates a major problem (detected by the test case itself) in running the test. This is usually an unrecoverable error, such as a missing file or loss of communication to the target. (POSIX testsuites should not emit this message; use \i UNSUPPORTED\i0 , \i UNTESTED\i0 , or \i UNRESOLVED\i0 instead, as appropriate.)\hyphpar0\par\pard\sb200\sl220\qj WARNING\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Indicates a possible problem in running the test. Usually warnings correspond to recoverable errors, or display an important message about the following tests.\hyphpar0\par\pard\sb200\sl220\qj NOTE\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab An informational message about the test case.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_INVOKING}{\*\bkmkend ID_INVOKING}\b\fs22\f2 Invoking Runtest\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This is the full set of command line options that \fs18\f3 runtest\fs20\f1 recognizes. Arguments may be abbreviated to the shortest unique string.\hyphpar0\par\pard\sb200\sl220\qj \fs18\lang1024\f3 --all\fs20\f1 (-a)\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Display all test output. By default, \i runtest\i0 shows only the output of tests that produce unexpected results; that is, tests with status \i FAIL\i0 (unexpected failure), \i XPASS\i0 (unexpected success), or \i ERROR\i0 (a severe error in the test case itself). Specify \i --all\i0 to see output for tests with status \i PASS\i0 (success, as expected) \i XFAIL\i0 (failure, as expected), or \i WARNING\i0 (minor error in the test case itself).\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --build [string]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \i string\i0 is a full configuration ``triple'' name as used by \b configure\b0 . This is the type of machine DejaGnu and the tools to be tested are built on. For a normal cross this is the same as the host, but for a canadian cross, they are seperate.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --host [string]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab string is a full configuration ``triple'' name as used by \i configure\i0 . Use this option to override the default string recorded by your configuration's choice of host. This choice does not change how anything is actually configured unless --build is also specified; it affects \i only\i0 DejaGnu procedures that compare the host string with particular values. The procedures \i ishost\i0 , \i istarget\i0 , \i isnative\i0 , and \i setup\i0 xfail\} are affected by \i --host\i0 . In this usage, \i host\i0 refers to the machine that the tests are to be run on, which may not be the same as the \i build\i0 machine. If \i --build\i0 is also specified, then \i --host\i0 refers to the machine that the tests wil, be run on, not the machine DejaGnu is run on.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --host_board [name]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab The host board to use.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --target [string]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Use this option to override the default setting (running native tests). \i string\i0 is a full configuration ``triple'' name of the form \i cpu-vendor-os\i0 as used by \b configure\b0 . This option changes the configuration \i runtest\i0 uses for the default tool names, and other setup information.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --debug\fs20\f1 (-de)\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Turns on the \i expect\i0 internal debugging output. Debugging output is displayed as part of the \i runtest\i0 output, and logged to a file called \fs18\f3 dbg.log\fs20\f1 . The extra debugging output does \i not\i0 appear on standard output, unless the verbose level is greater than 2 (for instance, to see debug output immediately, specify \i --debug\i0 -v -v\}). The debugging output shows all attempts at matching the test output of the tool with the scripted patterns describing expected output. The output generated with \i --strace\i0 also goes into \fs18\f3 dbg.log\fs20\f1 .\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --help\fs20\f1 (-he)\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Prints out a short summary of the \i runtest\i0 options, then exits (even if you also specify other options).\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --ignore [name(s)] \keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab The names of specific tests to ignore.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --objdir [path]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Use \i path\i0 as the top directory containing any auxiliary compiled test code. This defaults to \fs18\f3 .\fs20\f1 . Use this option to locate pre-compiled test code. You can normally prepare any auxiliary files needed with \i make\i0 .\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --outdir [path]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Write output logs in directory \fs18\f3 path\fs20\f1 . The default is \i .\}, the\i0 directory where you start \i runtest\i0 . This option affects only the summary and the detailed log files \fs18\f3 tool.sum\fs20\f1 and \fs18\f3 tool.log\fs20\f1 . The DejaGnu debug log \fs18\f3 dbg.log\fs20\f1 always appears (when requested) in the local directory.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --reboot [name]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Reboot the target board when \i runtest\i0 initializes. Usually, when running tests on a separate target board, it is safer to reboot the target to be certain of its state. However, when developing test scripts, rebooting takes a lot of time.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --srcdir [path]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Use \fs18\f3 path\fs20\f1 as the top directory for test scripts to run. \i runtest\i0 looks in this directory for any subdirectory whose name begins with the toolname (specified with \i --tool\i0 ). For instance, with \i --tool\i0 gdb\}, \i runtest\i0 uses tests in subdirectories \fs18\f3 gdb.*\fs20\f1 (with the usual shell-like filename expansion). If you do not use \i --srcdir\i0 , \i runtest\i0 looks for test directories under the current working directory.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --strace [number]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Turn on internal tracing for \i expect\i0 , to n levels deep. By adjusting the level, you can control the extent to which your output expands multi-level Tcl statements. This allows you to ignore some levels of \i case\i0 or \i if\i0 statements. Each procedure call or control structure counts as one ``level''. The output is recorded in the same file, \fs18\f3 dbg.log\fs20\f1 , used for output from \i --debug\i0 .\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --connect [program]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Connect to a target testing environment as specified by \i type\i0 , if the target is not the computer running \i runtest\i0 . For example, use \i --connect\i0 to change the program used to connect to a ``bare board'' boot monitor. The choices for \i type\i0 in the DejaGnu 1.4 distribution are \i rlogin\i0 , \i telnet\i0 , \i rsh\i0 , \i tip\i0 , \i kermit\i0 , and \i mondfe\i0 .\hyphpar0\par\pard\sb100\li1360\sl220\qj \lang1033 The default for this option depends on the configuration most convenient communication method available, but often other alternatives work as well; you may find it useful to try alternative connect methods if you suspect a communication problem with your testing target.\hyphpar0\par\pard\sb200\sl220\qj \fs18\lang1024\f3 --baud [number]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Set the default baud rate to something other than 9600. (Some serial interface programs, like \i tip\i0 , use a separate initialization file instead of this value.)\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --target_board [name(s)]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab The list of target boards to run tests on.\hyphpar0\par\pard\sb200\sl220\qj {\*\bkmkstart ID_TOOL_45_OPT}{\*\bkmkend ID_TOOL_45_OPT}\fs18\f3 --tool[name(s)]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Specifies which testsuite to run, and what initialization module to use. \fs18\f3 --tool\fs20\f1 is used \i only\i0 for these two purposes. It is \i not\i0 used to name the executable program to test. Executable tool names (and paths) are recorded in \fs18\f3 site.exp\fs20\f1 and you can override them by specifying Tcl variables on the command line.\hyphpar0\par\pard\sb100\li1360\sl220\qj \lang1033 For example, including "\fs18\f3 --tool\fs20\f1 gcc" on the \i runtest\i0 command line runs tests from all test subdirectories whose names match \fs18\f3 gcc.*\fs20\f1 , and uses one of the initialization modules named \fs18\f3 config/*-gcc.exp\fs20\f1 . To specify the name of the compiler (perhaps as an alternative path to what \i runtest\i0 would use by default), use \i GCC=binname\i0 on the \i runtest\i0 command line.\hyphpar0\par\pard\sb200\sl220\qj \fs18\lang1024\f3 --tool_exec [name]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab The path to the tool executable to test.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --tool_opts [options]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab A list of additional options to pass to the tool.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --verbose\fs20\f1 (-v)\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Turns on more output. Repeating this option increases the amount of output displayed. Level one (\i -v\i0 ) is simply test output. Level two (\i -v\i0 -v\}) shows messages on options, configuration, and process control. Verbose messages appear in the detailed (\fs18\f3 *.log\fs20\f1 ) log file, but not in the summary (\fs18\f3 *.sum\fs20\f1 ) log file.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --version\fs20\f1 (-V)\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Prints out the version numbers of DejaGnu, \i expect\i0 and Tcl, and exits without running any tests.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 --D[0-1]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab Start the internal Tcl debugger. The Tcl debugger supports breakpoints, single stepping, and other common debugging activities. See the document "Debugger for Tcl Applications" by Don Libes. (Distributed in PostScript form with \i expect\i0 as the file \fs18\f3 expect/tcl-debug.ps.\fs20\f1 . If you specify \i -D1\i0 , the \i expect\i0 shell stops at a breakpoint as soon as DejaGnu invokes it. If you specify \i -D0\i0 , DejaGnu starts as usual, but you can enter the debugger by sending an interrupt (e.g. by typing \b C\b0 -\b c\b0 ). \hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 testfile\fs20\f1 .exp[=arg(s)]\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Specify the names of testsuites to run. By default, \i runtest\i0 runs all tests for the tool, but you can restrict it to particular testsuites by giving the names of the \i .exp expect\i0 scripts that control them. \i testsuite\i0 .exp may not include path information; use plain filenames.\hyphpar0\par\pard\sb200\sl220\qj \fs18\f3 testfile\fs20\f1 .exp="testfile1 ..."\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab Specify a subset of tests in a suite to run. For compiler or assembler tests, which often use a single \i .exp\i0 script covering many different source files, this option allows you to further restrict the tests by listing particular source files to compile. Some tools even support wildcards here. The wildcards supported depend upon the tool, but typically they are \i ?\i0 , \i *\i0 , and \i [chars]\i0 .\hyphpar0\par\pard\sb200\sl220\qj tclvar=value\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab You can define Tcl variables for use by your test scripts in the same style used with \i make\i0 for environment variables. For example, \i runtest GDB=gdb.old\i0 defines a variable called \b GDB\b0 ; when your scripts refer to $GDB in this run, they use the value \i gdb.old\i0 .\hyphpar0\par\pard\sb100\li1360\sl220\qj \lang1033 The default Tcl variables used for most tools are defined in the main DejaGnu \i Makefile\i0 ; their values are captured in the \fs18\f3 site.exp\fs20\f1 file.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_COMMON}{\*\bkmkend ID_COMMON}\b\fs22\lang1024\f2 Common Options\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 Typically, you don't need must to use any command-line options. \fs18\f3 --tool\fs20\f1 used is only required when there are more than one testsuite in the same directory. The default options are in the local site.exp file, created by "make site.exp".\hyphpar0\par\pard\sb100\li960\sl220\qj For example, if the directory \fs18\f3 gdb/testsuite\fs20\f1 contains a collection of DejaGnu tests for GDB, you can run them like this:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 eg$ cd gdb/testsuite\sa0\par\fi0\sb0
eg$ runtest --tool gdb\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Test output follows, ending with:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 === gdb Summary ===\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# of expected passes 508\sa0\par\fi0\sb0
# of expected failures 103\sa0\par\fi0\sb0
/usr/latest/bin/gdb version 4.14.4 -nx\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 You can use the option \i --srcdir\i0 to point to some other directory containing a collection of tests:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 eg$ runtest--srcdir /devo/gdb/testsuite\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 By default, \b runtest\b0 prints only the names of the tests it runs, output from any tests that have unexpected results, and a summary showing how many tests passed and how many failed. To display output from all tests (whether or not they behave as expected), use the \i --all\i0 option. For more verbose output about processes being run, communication, and so on, use \i --verbose\i0 . To see even more output, use multiple \i --verbose\i0 options. for a more detailed explanation of each \b runtest\b0 option.\hyphpar0\par\pard\sb100\li960\sl220\qj Test output goes into two files in your current directory: summary output in \fs18\f3 tool.sum\fs20\f1 , and detailed output in \fs18\f3 tool.log\fs20\f1 . (\i tool\i0 refers to the collection of tests; for example, after a run with \i --tool\i0 gdb, look for output files \fs18\f3 gdb.sum\fs20\f1 and \fs18\f3 gdb.log\fs20\f1 .)\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_OUTPUTFILES}{\*\bkmkend ID_OUTPUTFILES}\b\fs24\lang1024\f2 The files DejaGnu produces.\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu always writes two kinds of output files: summary logs and detailed logs. The contents of both of these are determined by your tests.\hyphpar0\par\pard\sb100\li960\sl220\qj For troubleshooting, a third kind of output file is useful: use \fs18\f3 --debug\fs20\f1 to request an output file showing details of what Expect is doing internally.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_SUM}{\*\bkmkend ID_SUM}\b\fs22\lang1024\f2 Summary File\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu always produces a summary output file \fs18\f3 tool.sum\fs20\f1 . This summary shows the names of all test files run; for each test file, one line of output from each \b pass\b0 command (showing status \i PASS\i0 or \i XPASS\i0 ) or \b fail\b0 command (status \i FAIL\i0 or \i XFAIL\i0 ); trailing summary statistics that count passing and failing tests (expected and unexpected); and the full pathname and version number of the tool tested. (All possible outcomes, and all errors, are always reflected in the summary output file, regardless of whether or not you specify \fs18\f3 --all\fs20\f1 .)\hyphpar0\par\pard\sb100\li960\sl220\qj If any of your tests use the procedures \b unresolved\b0 , \b unsupported\b0 , or \b runtested\b0 , the summary output also tabulates the corresponding outcomes.\hyphpar0\par\pard\sb100\li960\sl220\qj For example, after \b runtest --tool binutils\b0 , look for a summary log in \fs18\f3 binutils.sum\fs20\f1 . Normally, DejaGnu writes this file in your current working directory; use the \fs18\f3 --outdir\fs20\f1 option to select a different directory.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 3-1. Here is a short sample summary log\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 Test Run By rob on Mon May 25 21:40:57 PDT 1992\sa0\par\fi0\sb0
=== gdb tests ===\sa0\par\fi0\sb0
Running ./gdb.t00/echo.exp ...\sa0\par\fi0\sb0
PASS: Echo test\sa0\par\fi0\sb0
Running ./gdb.all/help.exp ...\sa0\par\fi0\sb0
PASS: help add-symbol-file\sa0\par\fi0\sb0
PASS: help aliases\sa0\par\fi0\sb0
PASS: help breakpoint "bre" abbreviation\sa0\par\fi0\sb0
FAIL: help run "r" abbreviation\sa0\par\fi0\sb0
Running ./gdb.t10/crossload.exp ...\sa0\par\fi0\sb0
PASS: m68k-elf (elf-big) explicit format; loaded\sa0\par\fi0\sb0
XFAIL: mips-ecoff (ecoff-bigmips) "ptype v_signed_char" signed C types\sa0\par\fi0\sb0
=== gdb Summary ===\sa0\par\fi0\sb0
# of expected passes 5\sa0\par\fi0\sb0
# of expected failures 1\sa0\par\fi0\sb0
# of unexpected failures 1\sa0\par\fi0\sb0
/usr/latest/bin/gdb version 4.6.5 -q\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_LOG}{\*\bkmkend ID_LOG}\b\fs22\f2 Log File\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu also saves a detailed log file \fs18\f3 tool.log\fs20\f1 , showing any output generated by tests as well as the summary output. For example, after \b runtest --tool binutils\b0 , look for a detailed log in \fs18\f3 binutils.log\fs20\f1 . Normally, DejaGnu writes this file in your current working directory; use the \fs18\f3 --outdir\fs20\f1 option to select a different directory.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 3-2. Here is a brief example showing a detailed log for G++ tests\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 Test Run By rob on Mon May 25 21:40:43 PDT 1992\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
=== g++ tests ===\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
--- Running ./g++.other/t01-1.exp ---\sa0\par\fi0\sb0
PASS: operate delete\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
--- Running ./g++.other/t01-2.exp ---\sa0\par\fi0\sb0
FAIL: i960 bug EOF\sa0\par\fi0\sb0
p0000646.C: In function `int warn_return_1 ()':\sa0\par\fi0\sb0
p0000646.C:109: warning: control reaches end of non-void function\sa0\par\fi0\sb0
p0000646.C: In function `int warn_return_arg (int)':\sa0\par\fi0\sb0
p0000646.C:117: warning: control reaches end of non-void function\sa0\par\fi0\sb0
p0000646.C: In function `int warn_return_sum (int, int)':\sa0\par\fi0\sb0
p0000646.C:125: warning: control reaches end of non-void function\sa0\par\fi0\sb0
p0000646.C: In function `struct foo warn_return_foo ()':\sa0\par\fi0\sb0
p0000646.C:132: warning: control reaches end of non-void function\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
--- Running ./g++.other/t01-4.exp ---\sa0\par\fi0\sb0
FAIL: abort\sa0\par\fi0\sb0
900403_04.C:8: zero width for bit-field `foo'\sa0\par\fi0\sb0
--- Running ./g++.other/t01-3.exp ---\sa0\par\fi0\sb0
FAIL: segment violation\sa0\par\fi0\sb0
900519_12.C:9: parse error before `;'\sa0\par\fi0\sb0
900519_12.C:12: Segmentation violation\sa0\par\fi0\sb0
/usr/latest/bin/gcc: Internal compiler error: program cc1plus got fatal signal\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
=== g++ Summary ===\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# of expected passes 1\sa0\par\fi0\sb0
# of expected failures 3\sa0\par\fi0\sb0
/usr/latest/bin/g++ version cygnus-2.0.1\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_DEBUGFILE}{\*\bkmkend ID_DEBUGFILE}\b\fs22\f2 Debug Log File\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 With the \fs18\f3 --debug\fs20\f1 option, you can request a log file showing the output from Expect itself, running in debugging mode. This file (\fs18\f3 dbg.log\fs20\f1 , in the directory where you start \b runtest\b0 ) shows each pattern Expect considers in analyzing test output.\hyphpar0\par\pard\sb100\li960\sl220\qj This file reflects each \b send\b0 command, showing the string sent as input to the tool under test; and each Expect command, showing each pattern it compares with the tool output.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 3-3. The log messages begin with a message of the form\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 \sa0\par\fi0\sb0
expect: does \{tool output\} (spawn_id n)\sa0\par\fi0\sb0
match pattern \{\i expected pattern\i0 \}?\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 For every unsuccessful match, Expect issues a \i no\i0 after this message; if other patterns are specified for the same Expect command, they are reflected also, but without the first part of the message (\i expect... match pattern\i0 ).\hyphpar0\par\pard\sb100\li960\sl220\qj When Expect finds a match, the log for the successful match ends with \i yes\i0 , followed by a record of the Expect variables set to describe a successful match.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 3-4. Here is an excerpt from the debugging log for a GDB test:\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 send: sent \{break gdbme.c:34\\n\} to spawn id 6\sa0\par\fi0\sb0
expect: does \{\} (spawn_id 6) match pattern \{Breakpoint.*at.* file\sa0\par\fi0\sb0
gdbme.c, line 34.*\\(gdb\\) $\}? no\sa0\par\fi0\sb0
\{.*\\(gdb\\) $\}? no\sa0\par\fi0\sb0
expect: does \{\} (spawn_id 0) match pattern \{return\} ? no\sa0\par\fi0\sb0
\{\\(y or n\\) \}? no\sa0\par\fi0\sb0
\{buffer_full\}? no\sa0\par\fi0\sb0
\{virtual\}? no\sa0\par\fi0\sb0
\{memory\}? no\sa0\par\fi0\sb0
\{exhausted\}? no\sa0\par\fi0\sb0
\{Undefined\}? no\sa0\par\fi0\sb0
\{command\}? no\sa0\par\fi0\sb0
break gdbme.c:34\sa0\par\fi0\sb0
Breakpoint 8 at 0x23d8: file gdbme.c, line 34.\sa0\par\fi0\sb0
(gdb) expect: does \{break gdbme.c:34\\r\\nBreakpoint 8 at 0x23d8:\sa0\par\fi0\sb0
file gdbme.c, line 34.\\r\\n(gdb) \} (spawn_id 6) match pattern\sa0\par\fi0\sb0
\{Breakpoint.*at.* file gdbme.c, line 34.*\\(gdb\\) $\}? yes\sa0\par\fi0\sb0
expect: set expect_out(0,start) \{18\}\sa0\par\fi0\sb0
expect: set expect_out(0,end) \{71\}\sa0\par\fi0\sb0
expect: set expect_out(0,string) \{Breakpoint 8 at 0x23d8: file\sa0\par\fi0\sb0
gdbme.c, line 34.\\r\\n(gdb) \}\sa0\par\fi0\sb0
epect: set expect_out(spawn_id) \{6\}\sa0\par\fi0\sb0
expect: set expect_out(buffer) \{break gdbme.c:34\\r\\nBreakpoint 8\sa0\par\fi0\sb0
at 0x23d8: file gdbme.c, line 34.\\r\\n(gdb) \}\sa0\par\fi0\sb0
PASS: 70 0 breakpoint line number in file\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 This example exhibits three properties of Expect and DejaGnu that might be surprising at first glance:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Empty output for the first attempted match. The first set of attempted matches shown ran against the output \i \{\}\i0 --- that is, no output. Expect begins attempting to match the patterns supplied immediately; often, the first pass is against incomplete output (or completely before all output, as in this case).\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Interspersed tool output. The beginning of the log entry for the second attempted match may be hard to spot: this is because the prompt \i \{(gdb) \}\i0 appears on the same line, just before the \i expect:\i0 that marks the beginning of the log entry.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Fail-safe patterns. Many of the patterns tested are fail-safe patterns provided by GDB testing utilities, to reduce possible indeterminacy. It is useful to anticipate potential variations caused by extreme system conditions (GDB might issue the message \i virtual memory exhausted\i0 in rare circumstances), or by changes in the tested program (\i Undefined command\i0 is the likeliest outcome if the name of a tested command changes).\hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 The pattern \i \{return\}\i0 is a particularly interesting fail-safe to notice; it checks for an unexpected \b RET\b0 prompt. This may happen, for example, if the tested tool can filter output through a pager.\hyphpar0\par\pard\sb100\li1160\sl220\qj These fail-safe patterns (like the debugging log itself) are primarily useful while developing test scripts. Use the \b error\b0 procedure to make the actions for fail-safe patterns produce messages starting with \i ERROR\i0 on standard output, and in the detailed log file.\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 4. Customizing DejaGnu}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 4. Customizing DejaGnu}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_CUSTOMIZING}{\*\bkmkend ID_CUSTOMIZING}\b\fs29\f2 Chapter 4. Customizing DejaGnu\keepn\hyphpar0\par\pard\sb146\li960\sl220\qj \b0\fs20\lang1033\f1 The site configuration file, \fs18\f3 site.exp\fs20\f1 , captures configuration-dependent values and propagates them to the DejaGnu test environment using Tcl variables. This ties the DejaGnu test scripts into the \b configure\b0 and \b make\b0 programs. If this file is setup correctly, it is possible to execute a testsuite merely by typing \b runtest\b0 .\hyphpar0\par\pard\sb100\li960\sl220\qj DejaGnu supports two \fs18\f3 site.exp\fs20\f1 files. The multiple instances of \fs18\f3 site.exp\fs20\f1 are loaded in a fixed order built into DejaGnu. The first file loaded is the local file \fs18\f3 site.exp\fs20\f1 , and then the optional global \fs18\f3 site.exp\fs20\f1 file as pointed to by the DEJAGNU environment variable.\hyphpar0\par\pard\sb100\li960\sl220\qj There is an optional \i master\i0 \fs18\f3 site.exp\fs20\f1 , capturing configuration values that apply to DejaGnu across the board, in each configuration-specific subdirectory of the DejaGnu library directory. \b runtest\b0 loads these values first. The master \fs18\f3 site.exp\fs20\f1 contains the default values for all targets and hosts supported by DejaGnu. This master file is identified by setting the environment variable DEJAGNU to the name of the file. This is also refered to as the ``global'' config file.\hyphpar0\par\pard\sb100\li960\sl220\qj Any directory containing a configured testsuite also has a local \fs18\f3 site.exp\fs20\f1 , capturing configuration values specific to the tool under test. Since \b runtest\b0 loads these values last, the individual test configuration can either rely on and use, or override, any of the global values from the global \fs18\f3 site.exp\fs20\f1 file.\hyphpar0\par\pard\sb100\li960\sl220\qj You can usually generate or update the testsuite's local \fs18\f3 site.exp\fs20\f1 by typing \b make site.exp\b0 in the testsuite directory, after the test suite is configured.\hyphpar0\par\pard\sb100\li960\sl220\qj You can also have a file in your home directory called \fs18\f3 .dejagnurc\fs20\f1 . This gets loaded first before the other config files. Usually this is used for personal stuff, like setting the all_flag so all the output gets printed, or your own verbosity levels. This file is usually restricted to setting command line options.\hyphpar0\par\pard\sb100\li960\sl220\qj You can further override the default values in a user-editable section of any \fs18\f3 site.exp\fs20\f1 , or by setting variables on the \b runtest\b0 command line.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_LOCAL}{\*\bkmkend ID_LOCAL}\b\fs24\lang1024\f2 Local Config File\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 It is usually more convenient to keep these \i manual overrides\i0 in the \fs18\f3 site.exp\fs20\f1 local to each test directory, rather than in the global \fs18\f3 site.exp\fs20\f1 in the installed DejaGnu library. This file is mostly for supplying tool specific info that is required by the testsuite.\hyphpar0\par\pard\sb100\li960\sl220\qj All local \fs18\f3 site.exp\fs20\f1 files have two sections, separated by comment text. The first section is the part that is generated by \b make\b0 . It is essentially a collection of Tcl variable definitions based on \fs18\f3 Makefile\fs20\f1 environment variables. Since they are generated by \b make\b0 , they contain the values as specified by \b configure\b0 . (You can also customize these values by using the \fs18\f3 --site\fs20\f1 option to \b configure\b0 .) In particular, this section contains the \fs18\f3 Makefile\fs20\f1 variables for host and target configuration data. Do not edit this first section; if you do, your changes are replaced next time you run \b make\b0 .\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-1. The first section starts with\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 ## these variables are automatically generated by make ##\sa0\par\fi0\sb0
# Do not edit here. If you wish to override these values\sa0\par\fi0\sb0
# add them to the last section\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 In the second section, you can override any default values (locally to DejaGnu) for all the variables. The second section can also contain your preferred defaults for all the command line options to \b runtest\b0 . This allows you to easily customize \b runtest\b0 for your preferences in each configured test-suite tree, so that you need not type options repeatedly on the command line. (The second section may also be empty, if you do not wish to override any defaults.)\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-2. The first section ends with this line\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 ## All variables above are generated by configure. Do Not Edit ##\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 You can make any changes under this line. If you wish to redefine a variable in the top section, then just put a duplicate value in this second section. Usually the values defined in this config file are related to the configuration of the test run. This is the ideal place to set the variables host_triplet, build_triplet, target_triplet. All other variables are tool dependant, i.e., for testing a compiler, the value for CC might be set to a freshly built binary, as opposed to one in the user's path.\hyphpar0\par\pard\sb100\li960\sl220\qj Here's an example local site.exp file, as used for GCC/G++ testing.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-3. Local Config File\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 ## these variables are automatically generated by make ##\sa0\par\fi0\sb0
# Do not edit here. If you wish to override these values\sa0\par\fi0\sb0
# add them to the last section\sa0\par\fi0\sb0
set rootme "/build/devo-builds/i586-pc-linux-gnulibc1/gcc"\sa0\par\fi0\sb0
set host_triplet i586-pc-linux-gnulibc1\sa0\par\fi0\sb0
set build_triplet i586-pc-linux-gnulibc1\sa0\par\fi0\sb0
set target_triplet i586-pc-linux-gnulibc1\sa0\par\fi0\sb0
set target_alias i586-pc-linux-gnulibc1\sa0\par\fi0\sb0
set CFLAGS ""\sa0\par\fi0\sb0
set CXXFLAGS "-isystem /build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libio -isystem $srcdir/../libg++/src -isystem $srcdir/../libio -isystem $srcdir/../libstdc++ -isystem $srcdir/../libstdc++/stl -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libg++ -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libstdc++"\sa0\par\fi0\sb0
append LDFLAGS " -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../ld"\sa0\par\fi0\sb0
set tmpdir /build/devo-builds/i586-pc-linux-gnulibc1/gcc/testsuite\sa0\par\fi0\sb0
set srcdir "$\{srcdir\}/testsuite"\sa0\par\fi0\sb0
## All variables above are generated by configure. Do Not Edit ##\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 This file defines the required fields for a local config file, namely the three config triplets, and the srcdir. It also defines several other Tcl variables that are used exclusivly by the GCC testsuite. For most test cases, the CXXFLAGS and LDFLAGS are supplied by DejaGnu itself for cross testing, but to test a compiler, GCC needs to manipulate these itself.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_GLOBAL}{\*\bkmkend ID_GLOBAL}\b\fs24\lang1024\f2 Global Config File\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 The master config file is where all the target specific config variables for a whole site get set. The idea is that for a centralized testing lab where people have to share a target between multiple developers. There are settings for both remote targets and remote hosts. Here's an example of a Master Config File (also called the Global config file) for a \i canadian cross\i0 . A canadian cross is when you build and test a cross compiler on a machine other than the one it's to be hosted on.\hyphpar0\par\pard\sb100\li960\sl220\qj Here we have the config settings for our California office. Note that all config values are site dependant. Here we have two sets of values that we use for testing m68k-aout cross compilers. As both of these target boards has a different debugging protocol, we test on both of them in sequence.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-4. Global Config file\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 \sa0\par\fi0\sb0
# Make sure we look in the right place for the board description files.\sa0\par\fi0\sb0
if ![info exists boards_dir] \{\sa0\par\fi0\sb0
set boards_dir \{\}\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
lappend boards_dir "/nfs/cygint/s1/cygnus/dejagnu/boards"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
verbose "Global Config File: target_triplet is $target_triplet" 2\sa0\par\fi0\sb0
global target_list\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
case "$target_triplet" in \{\sa0\par\fi0\sb0
\{ "native" \} \{\sa0\par\fi0\sb0
set target_list "unix"\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\{ "sparc64-*elf" \} \{\sa0\par\fi0\sb0
set target_list "sparc64-sim"\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\{ "mips-*elf" \} \{\sa0\par\fi0\sb0
set target_list "mips-sim wilma barney"\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\{ "mips-lsi-elf" \} \{\sa0\par\fi0\sb0
set target_list "mips-lsi-sim\{,soft-float,el\}"\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\{ "sh-*hms" \} \{\sa0\par\fi0\sb0
set target_list \{ "sh-hms-sim" "bloozy" \}\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 In this case, we have support for several cross compilers, that all run on this host. For testing on operating systems that don't support Expect, DejaGnu can be run on the local build machine, and it can connect to the remote host and run all the tests for this cross compiler on that host. All the remote OS requires is a working telnetd.\hyphpar0\par\pard\sb100\li960\sl220\qj As you can see, all one does is set the variable target_list to the list of targets and options to test. The simple settings, like for \i sparc64-elf\i0 only require setting the name of the single board config file. The \i mips-elf\i0 target is more complicated. Here it sets the list to three target boards. One is the default mips target, and both \i wilma\i0 \i barney\i0 are symbolic names for other mips boards. Symbolic names are covered in the {\field{\*\fldinst HYPERLINK \\l ID_ADDBOARD}{\fldrslt Adding A New Board}} chapter. The more complicated example is the one for \i mips-lsi-elf\i0 . This one runs the tests with multiple iterations using all possible combinations of the \fs18\f3 --soft-float\fs20\f1 and the \fs18\f3 --el\fs20\f1 (little endian) option. Needless to say, this last feature is mostly compiler specific.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_BOARDCONFIG}{\*\bkmkend ID_BOARDCONFIG}\b\fs24\lang1024\f2 Board Config File\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 The board config file is where board specfic config data is stored. A board config file contains all the higher-level configuration settings. There is a rough inheritance scheme, where it is possible to base a new board description file on an existing one. There are also collections of custom procedures for common environments. For more information on adding a new board config file, go to the {\field{\*\fldinst HYPERLINK \\l ID_ADDBOARD}{\fldrslt Adding A New Board}} chapter. \hyphpar0\par\pard\sb100\li960\sl220\qj An example board config file for a GNU simulator is as follows. \fs18\f3 set_board_info\fs20\f1 is a procedure that sets the field name to the specified value. The procedures in square brackets \i []\i0 are \i helper procedures\i0 . Thes are used to find parts of a tool chain required to build an executable image that may reside in various locations. This is mostly of use for when the startup code, the standard C lobraries, or the tool chain itself is part of your build tree.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-5. Board Config File\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 # This is a list of toolchains that are supported on this board.\sa0\par\fi0\sb0
set_board_info target_install \{sparc64-elf\}\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# Load the generic configuration for this board. This will define any\sa0\par\fi0\sb0
# routines needed by the tool to communicate with the board.\sa0\par\fi0\sb0
load_generic_config "sim"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# We need this for find_gcc and *_include_flags/*_link_flags.\sa0\par\fi0\sb0
load_base_board_description "basic-sim"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# Use long64 by default.\sa0\par\fi0\sb0
process_multilib_options "long64"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
setup_sim sparc64\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# We only support newlib on this target. We assume that all multilib\sa0\par\fi0\sb0
# options have been specified before we get here.\sa0\par\fi0\sb0
set_board_info compiler "[find_gcc]"\sa0\par\fi0\sb0
set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"\sa0\par\fi0\sb0
set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"\sa0\par\fi0\sb0
# No linker script.\sa0\par\fi0\sb0
set_board_info ldscript "";\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# Used by a few gcc.c-torture testcases to delimit how large the\sa0\par\fi0\sb0
# stack can be.\sa0\par\fi0\sb0
set_board_info gcc,stack_size 16384\sa0\par\fi0\sb0
# The simulator doesn't return exit statuses and we need to indicate this\sa0\par\fi0\sb0
# the standard GCC wrapper will work with this target.\sa0\par\fi0\sb0
set_board_info needs_status_wrapper 1\sa0\par\fi0\sb0
# We can't pass arguments to programs.\sa0\par\fi0\sb0
set_board_info noargs 1\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 There are five helper procedures used in this example. The first one, \fs18\f3 find gcc\fs20\f1 looks for a copy of the GNU compiler in your build tree, or it uses the one in your path. This will also return the proper transformed name for a cross compiler if you whole build tree is configured for one. The next helper procedures are \fs18\f3 libgloss_include_flags\fs20\f1 & \fs18\f3 libgloss_link_flags\fs20\f1 . These return the proper flags to compiler and link an executable image using {\field{\*\fldinst HYPERLINK \\l ID_LIBGLOSS}{\fldrslt Libgloss}}, the GNU BSP (Board Support Package). The final procedures are \fs18\f3 newlib_include_flag\fs20\f1 & \fs18\f3 newlib_include_flag\fs20\f1 . These find the Newlib C library, which is a reentrant standard C library for embedded systems comprising of non GPL'd code.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_RELENG}{\*\bkmkend ID_RELENG}\b\fs24\lang1024\f2 Remote Host Testing\keepn\hyphpar0\par\pard\sb200\li1360\sl198\qj \fs18 Note: \b0\f4 Thanks to Dj Delorie for the original paper that this section is based on.\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 DejaGnu also supports running the tests on a remote host. To set this up, the remote host needs an ftp server, and a telnet server. Currently foreign operating systems used as remote hosts are VxWorks, VRTX, DOS/Windows 3.1, MacOS and Windows.\hyphpar0\par\pard\sb100\li960\sl220\qj The recommended source for a Windows-based FTP server is to get IIS (either IIS 1 or Personal Web Server) from http://www.microsoft.com. When you install it, make sure you install the FTP server - it's not selected by default. Go into the IIS manager and change the FTP server so that it does not allow anonymous FTP. Set the home directory to the root directory (i.e. c:\\) of a suitable drive. Allow writing via FTP.\hyphpar0\par\pard\sb100\li960\sl220\qj It will create an account like IUSR_FOOBAR where foobar is the name of your machine. Go into the user editor and give that account a password that you don't mind hanging around in the clear (i.e. not the same as your admin or personal passwords). Also, add it to all the various permission groups.\hyphpar0\par\pard\sb100\li960\sl220\qj You'll also need a telnet server. For Windows, go to the Ataman\up8\fs12 2\up0\fs20 web site, pick up the Ataman Remote Logon Services for Windows, and install it. You can get started on the eval period anyway. Add IUSR_FOOBAR to the list of allowed users, set the HOME directory to be the same as the FTP default directory. Change the Mode prompt to simple.\hyphpar0\par\pard\sb100\li960\sl220\qj Ok, now you need to pick a directory name to do all the testing in. For the sake of this example, we'll call it piggy (i.e. c:\\piggy). Create this directory.\hyphpar0\par\pard\sb100\li960\sl220\qj You'll need a unix machine. Create a directory for the scripts you'll need. For this example, we'll use /usr/local/swamp/testing. You'll need to have a source tree somewhere, say /usr/src/devo. Now, copy some files from releng's area in SV to your machine:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-6. Remote host setup\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 cd /usr/local/swamp/testing\sa0\par\fi0\sb0
mkdir boards\sa0\par\fi0\sb0
scp darkstar.welcomehome.org:/dejagnu/cst/bin/MkTestDir .\sa0\par\fi0\sb0
scp darkstar.welcomehome.org:/dejagnu/site.exp .\sa0\par\fi0\sb0
scp darkstar.welcomehome.org:/dejagnu/boards/useless98r2.exp boards/foobar.exp\sa0\par\fi0\sb0
export DEJAGNU=/usr/local/swamp/testing/site.exp\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 You must edit the boards/foobar.exp file to reflect your machine; change the hostname (foobar.com), username (iusr_foobar), password, and ftp_directory (c:/piggy) to match what you selected.\hyphpar0\par\pard\sb100\li960\sl220\qj Edit the global \fs18\f3 site.exp\fs20\f1 to reflect your boards directory:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-7. Add The Board Directory\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 lappend boards_dir "/usr/local/swamp/testing/boards"\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Now run MkTestDir, which is in the contrib directory. The first parameter is the toolchain prefix, the second is the location of your devo tree. If you are testing a cross compiler (ex: you have sh-hms-gcc.exe in your PATH on the PC), do something like this:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-8. Setup Cross Remote Testing\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 ./MkTestDir sh-hms /usr/dejagnu/src/devo\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 If you are testing a native PC compiler (ex: you have gcc.exe in your PATH on the PC), do this:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-9. Setup Native Remote Testing\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 ./MkTestDir '' /usr/dejagnu/src/devo\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 To test the setup, \b ftp\b0 to your PC using the username (iusr_foobar) and password you selected. CD to the test directory. Upload a file to the PC. Now telnet to your PC using the same username and password. CD to the test directory. Make sure the file is there. Type "set" and/or "gcc -v" (or sh-hms-gcc -v) and make sure the default PATH contains the installation you want to test.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-10. Run Test Remotely\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 cd /usr/local/swamp/testing\sa0\par\fi0\sb0
make -k -w check RUNTESTFLAGS="--host_board foobar --target_board foobar -v -v" > check.out 2>&1\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 To run a specific test, use a command like this (for this example, you'd run this from the gcc directory that MkTestDir created):\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-11. Run a Test Remotely\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 make check RUNTESTFLAGS="--host_board sloth --target_board sloth -v compile.exp=921202-1.c"\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Note: if you are testing a cross-compiler, put in the correct target board. You'll also have to download more .exp files and modify them for your local configuration. The -v's are optional.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_CONFIGFILE}{\*\bkmkend ID_CONFIGFILE}\b\fs24\lang1024\f2 Config File Values\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu uses a named array in Tcl to hold all the info for each machine. In the case of a canadian cross, this means host information as well as target information. The named array is called target_info, and it has two indices. The following fields are part of the array.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_OPTIONDEFS}{\*\bkmkend ID_OPTIONDEFS}\b\fs22\lang1024\f2 Command Line Option Variables\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 In the user editable second section of the {\field{\*\fldinst HYPERLINK \\l ID_PERSONAL}{\fldrslt Personal Config File}} you can not only override the configuration variables captured in the first section, but also specify default values for all on the \b runtest\b0 command line options. Save for \fs18\f3 --debug\fs20\f1 , \fs18\f3 --help\fs20\f1 , and \fs18\f3 --version\fs20\f1 , each command line option has an associated Tcl variable. Use the Tcl \b set\b0 command to specify a new default value (as for the configuration variables). The following table describes the correspondence between command line options and variables you can set in \fs18\f3 site.exp\fs20\f1 . {\field{\*\fldinst HYPERLINK \\l ID_INVOKING}{\fldrslt Invoking Runtest}}, for explanations of the command-line options.\hyphpar0\par\pard\sb200\li960\sl220\qj \b Table 4-1. Tcl Variables For Command Line Options\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 runtest\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 Tcl\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 option\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 variable\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\clbrdrt\brdrs\brdrw20\cellx6912\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --all\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 all_flag\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 display all test results if set\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --baud\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 baud\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 set the default baud rate to something other than 9600.\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --connect\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 connectmode\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f1 rlogin\b0 , \b telnet\b0 , \b rsh\b0 , \b kermit\b0 , \b tip\b0 , or \b mondfe\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --outdir\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 outdir\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 directory for \fs18\f3 tool.sum\fs20\f1 and \fs18\f3 tool.log.\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --objdir\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 objdir\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 directory for pre-compiled binaries\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --reboot\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 reboot\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 reboot the target if set to \i "1"\i0 ; do not reboot if set to \i "0"\i0 (the default).\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --srcdir\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 srcdir\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 directory of test subdirectories\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --strace\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 tracelevel\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 a number: Tcl trace depth\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --tool\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 tool\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 name of tool to test; identifies init, test subdir\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --verbose\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 verbose\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 verbosity level. As option, use multiple times; as variable, set a number, 0 or greater.\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --target\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 target_triplet\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The canonical configuration string for the target.\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --host\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 host_triplet\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The canonical configuration string for the host.\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\cellx6912\clvertalt\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --build\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 build_triplet\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The canonical configuration string for the build host.\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx2448\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx3936\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5424\clvertalt\clbrdrb\brdrs\brdrw20\cellx6912\clvertalt\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 --mail\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 address\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Email the output log to the specified address.\sa60\cell \plain \intbl\cell \plain \intbl\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 \hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_PERSONAL}{\*\bkmkend ID_PERSONAL}\b\fs22\lang1024\f2 Personal Config File\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 The personal config file is used to customize \b runtest's\b0 behaviour for each person. It's typically used to set the user prefered setting for verbosity, and any experimental Tcl procedures. My personal \fs18\f3 ~/.dejagnurc\fs20\f1 file looks like:\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 4-12. Personal Config File\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 set all_flag 1\sa0\par\fi0\sb0
set RLOGIN /usr/ucb/rlogin\sa0\par\fi0\sb0
set RSH /usr/local/sbin/ssh\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Here I set all_flag so I see all the test cases that PASS along with the ones that FAIL. I also set RLOGIN to the BSD version. I have Kerberos installed, and when I rlogin to a target board, it usually isn't supported. So I use the non secure version rather than the default that's in my path. I also set RSH to the SSH secure shell, as rsh is mostly used to test unix machines within a local network here.\hyphpar0\par\pard\sb200\sl293 \b\fs26\lang1024\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://www.microsoft.com\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 2. \tab http://ataman.com\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 5. Extending DejaGnu}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 5. Extending DejaGnu}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_EXTENDING}{\*\bkmkend ID_EXTENDING}\b\fs29\f2 Chapter 5. Extending DejaGnu\keepn\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_ADDSUITE}{\*\bkmkend ID_ADDSUITE}\fs24 Adding A New Testsuite\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 The testsuite for a new tool should always be located in that tools source directory. DejaGnu require the directory be named \fs18\f3 testsuite\fs20\f1 . Under this directory, the test cases go in a subdirectory whose name begins with the tool name. For example, for a tool named \i flubber\i0 , each subdirectory containing testsuites must start with \i "flubber."\i0 .\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_ADDTOOL}{\*\bkmkend ID_ADDTOOL}\b\fs24\lang1024\f2 Adding A New Tool\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 In general, the best way to learn how to write (code or even prose) is to read something similar. This principle applies to test cases and to testsuites. Unfortunately, well-established testsuites have a way of developing their own conventions: as test writers become more experienced with DejaGnu and with Tcl, they accumulate more utilities, and take advantage of more and more features of Expect and Tcl in general.\hyphpar0\par\pard\sb100\li960\sl220\qj Inspecting such established testsuites may make the prospect of creating an entirely new testsuite appear overwhelming. Nevertheless, it is quite straightforward to get a new testsuite going.\hyphpar0\par\pard\sb100\li960\sl220\qj There is one testsuite that is guaranteed not to grow more elaborate over time: both it and the tool it tests were created expressly to illustrate what it takes to get started with DejaGnu. The \fs18\f3 example/\fs20\f1 directory of the DejaGnu distribution contains both an interactive tool called \b calc\b0 , and a testsuite for it. Reading this testsuite, and experimenting with it, is a good way to supplement the information in this section. (Thanks to Robert Lupton for creating calc and its testsuite---and also the first version of this section of the manual!)\hyphpar0\par\pard\sb100\li960\sl220\qj To help orient you further in this task, here is an outline of the steps to begin building a testsuite for a program example.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Create or select a directory to contain your new collection of tests. Change into that directory (shown here as \fs18\f3 testsuite\fs20\f1 ):\hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 Create a \fs18\f3 configure.in\fs20\f1 file in this directory, to control configuration-dependent choices for your tests. So far as DejaGnu is concerned, the important thing is to set a value for the variable target_abbrev; this value is the link to the init file you will write soon. (For simplicity, we assume the environment is Unix, and use \i unix\i0 as the value.)\hyphpar0\par\pard\sb100\li1160\sl220\qj What else is needed in \fs18\f3 configure.in\fs20\f1 depends on the requirements of your tool, your intended test environments, and which configure system you use. This example is a minimal configure.in for use with GNU Autoconf. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Create \fs18\f3 Makefile.in\fs20\f1 (if you are using Autoconf), or \fs18\f3 Makefile.am\fs20\f1 (if you are using Automake), the source file used by configure to build your \fs18\f3 Makefile\fs20\f1 . If you are using GNU Automake.just add the keyword \i dejagnu\i0 to the \i AUTOMAKE_OPTIONS\i0 variable in your \fs18\f3 Makefile.am\fs20\f1 file. This will add all the Makefile support needed to run DejaGnu, and support the {\field{\*\fldinst HYPERLINK \\l ID_MAKECHECK}{\fldrslt Make Check}} target.\hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 You also need to include two targets important to DejaGnu: \i check\i0 , to run the tests, and \i site.exp\i0 , to set up the Tcl copies of configuration-dependent values. This is called the {\field{\*\fldinst HYPERLINK \\l ID_LOCAL}{\fldrslt Local Config File}} The check target must run the \b runtest\b0 program to execute the tests.\hyphpar0\par\pard\sb100\li1160\sl220\qj The \fs18\f3 site.exp\fs20\f1 target should usually set up (among other things) the $tool variable for the name of your program. If the local site.exp file is setup correctly, it is possible to execute the tests by merely typing \b runtest\b0 on the command line.\hyphpar0\par\pard\sb200\li1160\sl220\qj \b\lang1024 Example 5-1. Sample Makefile.in Fragment\keepn\hyphpar0\par\pard\sb100\li1160\sl198\qj \b0\fs18\f3 # Look for a local version of DejaGnu, otherwise use one in the path\sa0\par\fi0\sb0
RUNTEST = `if test -f $(top_srcdir)/../dejagnu/runtest; then \\\sa0\par\fi0\sb0
echo $(top_srcdir) ../dejagnu/runtest; \\\sa0\par\fi0\sb0
else \\\sa0\par\fi0\sb0
echo runtest; \\\sa0\par\fi0\sb0
fi`\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# The flags to pass to runtest\sa0\par\fi0\sb0
RUNTESTFLAGS =\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# Execute the tests\sa0\par\fi0\sb0
check: site.exp all\sa0\par\fi0\sb0
$(RUNTEST) $(RUNTESTFLAGS) \\\sa0\par\fi0\sb0
--tool $\{example\} --srcdir $(srcdir)\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# Make the local config file\sa0\par\fi0\sb0
site.exp: ./config.status Makefile\sa0\par\fi0\sb0
@echo "Making a new config file..."\sa0\par\fi0\sb0
-@rm -f ./tmp?\sa0\par\fi0\sb0
@touch site.exp\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
-@mv site.exp site.bak\sa0\par\fi0\sb0
@echo "## these variables are automatically\\\sa0\par\fi0\sb0
generated by make ##" > ./tmp0\sa0\par\fi0\sb0
@echo "# Do not edit here. If you wish to\\\sa0\par\fi0\sb0
override these values" >> ./tmp0\sa0\par\fi0\sb0
@echo "# add them to the last section" >> ./tmp0\sa0\par\fi0\sb0
@echo "set host_os $\{host_os\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set host_alias $\{host_alias\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set host_cpu $\{host_cpu\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set host_vendor $\{host_vendor\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set target_os $\{target_os\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set target_alias $\{target_alias\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set target_cpu $\{target_cpu\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set target_vendor $\{target_vendor\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set host_triplet $\{host_canonical\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set target_triplet $\{target_canonical\}">>./tmp0\sa0\par\fi0\sb0
@echo "set tool binutils" >> ./tmp0\sa0\par\fi0\sb0
@echo "set srcdir $\{srcdir\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "set objdir `pwd`" >> ./tmp0\sa0\par\fi0\sb0
@echo "set $\{examplename\} $\{example\}" >> ./tmp0\sa0\par\fi0\sb0
@echo "## All variables above are generated by\\\sa0\par\fi0\sb0
configure. Do Not Edit ##" >> ./tmp0\sa0\par\fi0\sb0
@cat ./tmp0 > site.exp\sa0\par\fi0\sb0
@sed < site.bak \\\sa0\par\fi0\sb0
-e '1,/^## All variables above are.*##/ d' \\\sa0\par\fi0\sb0
>> site.exp\sa0\par\fi0\sb0
-@rm -f ./tmp?\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li1160\sl220\fi-200\qj \tx1160 \fs16\f1 \'95\tab \fs20 Create a directory (in \fs18\f3 testsuite\fs20\f1 ) called \fs18\f3 config\fs20\f1 . Make a \i Tool Init File\i0 in this directory. Its name must start with the target_abbrev value, or be named \fs18\f3 default.exp\fs20\f1 so call it \fs18\f3 config/unix.exp\fs20\f1 for our Unix based example. This is the file that contains the target-dependent procedures. Fortunately, on Unix, most of them do not have to do very much in order for \b runtest\b0 to run.\hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 If the program being tested is not interactive, you can get away with this minimal \fs18\f3 unix.exp\fs20\f1 to begin with:\hyphpar0\par\pard\sb200\li1160\sl220\qj \b\lang1024 Example 5-2. Simple Batch Program Tool Init File\keepn\hyphpar0\par\pard\sb100\li1160\sl198\qj \b0\fs18\f3 \sa0\par\fi0\sb0
proc foo_exit \{\} \{\}\sa0\par\fi0\sb0
proc foo_version \{\} \{\}\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li1160\sl220\qj \fs20\lang1033\f1 If the program being tested is interactive, however, you might as well define a \i start\i0 routine and invoke it by using an init file like this:\hyphpar0\par\pard\sb200\li1160\sl220\qj \b\lang1024 Example 5-3. Simple Interactive Program Tool Init File\keepn\hyphpar0\par\pard\sb100\li1160\sl198\qj \b0\fs18\f3 \sa0\par\fi0\sb0
proc foo_exit \{\} \{\}\sa0\par\fi0\sb0
proc foo_version \{\} \{\}\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
proc foo_start \{\} \{\sa0\par\fi0\sb0
global $\{examplename\}\sa0\par\fi0\sb0
spawn $\{examplename\}\sa0\par\fi0\sb0
expect \{\sa0\par\fi0\sb0
-re "" \{\}\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# Start the program running we want to test\sa0\par\fi0\sb0
foo_start\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li1160\sl220\fi-200\qj \tx1160 \fs16\f1 \'95\tab \fs20 Create a directory whose name begins with your tool's name, to contain tests. For example, if your tool's name is \i gcc\i0 , then the directories all need to start with \i "gcc."\i0 .\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Create a sample test file. Its name must end with \fs18\f3 .exp\fs20\f1 . You can use \fs18\f3 first-try.exp\fs20\f1 . To begin with, just write there a line of Tcl code to issue a message.\hyphpar0\par\pard\sb200\li1160\sl220\qj \b Example 5-4. Testing A New Tool Config\keepn\hyphpar0\par\pard\sb100\li1160\sl198\qj \b0\fs18\f3 \sa0\par\fi0\sb0
send_user "Testing: one, two...\\n"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li1160\sl220\fi-200\qj \tx1160 \fs16\f1 \'95\tab \fs20 Back in the \fs18\f3 testsuite\fs20\f1 (top level) directory, run \b configure\b0 . Typically you do this while in the build directory. You may have to specify more of a path, if a suitable configure is not available in your execution path.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 e now ready to triumphantly type \b make check\b0 or \b runtest\b0 . You should see something like this:\hyphpar0\par\pard\sb200\li1160\sl220\qj \b Example 5-5. Example Test Case Run\keepn\hyphpar0\par\pard\sb100\li1160\sl198\qj \b0\fs18\f3 Test Run By rhl on Fri Jan 29 16:25:44 EST 1993\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
=== example tests ===\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
Running ./example.0/first-try.exp ...\sa0\par\fi0\sb0
Testing: one, two...\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
=== example Summary ===\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li1160\sl220\qj \fs20\lang1033\f1 There is no output in the summary, because so far the example does not call any of the procedures that establish a test outcome.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Write some real tests. For an interactive tool, you should probably write a real exit routine in fairly short order. In any case, you should also write a real version routine soon. \hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_ADDTARGET}{\*\bkmkend ID_ADDTARGET}\b\fs24\f2 Adding A New Target\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu has some additional requirements for target support, beyond the general-purpose provisions of configure. DejaGnu must actively communicate with the target, rather than simply generating or managing code for the target architecture. Therefore, each tool requires an initialization module for each target. For new targets, you must supply a few Tcl procedures to adapt DejaGnu to the target. This permits DejaGnu itself to remain target independent.\hyphpar0\par\pard\sb100\li960\sl220\qj Usually the best way to write a new initialization module is to edit an existing initialization module; some trial and error will be required. If necessary, you can use the @samp\{--debug\} option to see what is really going on.\hyphpar0\par\pard\sb100\li960\sl220\qj When you code an initialization module, be generous in printing information controlled by the \fs18\f3 verbose\fs20\f1 procedure.\hyphpar0\par\pard\sb100\li960\sl220\qj For cross targets, most of the work is in getting the communications right. Communications code (for several situations involving IP networks or serial lines) is available in a DejaGnu library file.\hyphpar0\par\pard\sb100\li960\sl220\qj If you suspect a communication problem, try running the connection interactively from Expect. (There are three ways of running Expect as an interactive interpreter. You can run Expect with no arguments, and control it completely interactively; or you can use \b expect -i\b0 together with other command-line options and arguments; or you can run the command \b interpreter\b0 from any Expect procedure. Use \b return\b0 to get back to the calling procedure (if any), or \b return -tcl\b0 to make the calling procedure itself return to its caller; use \b exi\b0 t or end-of-file to leave Expect altogether.) Run the program whose name is recorded in $connectmode, with the arguments in $targetname, to establish a connection. You should at least be able to get a prompt from any target that is physically connected.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_ADDBOARD}{\*\bkmkend ID_ADDBOARD}\b\fs24\lang1024\f2 Adding A New Board\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Adding a new board consists of creating a new board config file. Examples are in \fs18\f3 dejagnu/baseboards\fs20\f1 . Usually to make a new board file, it's easiest to copy an existing one. It is also possible to have your file be based on a \i baseboard\i0 file with only one or two changes needed. Typically, this can be as simple as just changing the linker script. Once the new baseboard file is done, add it to the boards_DATA list in the \fs18\f3 dejagnu/baseboards/Makefile.am\fs20\f1 , and regenerate the Makefile.in using automake. Then just rebuild and install DejaGnu. You can test it by:\hyphpar0\par\pard\sb100\li960\sl220\qj There is a crude inheritance scheme going on with board files, so you can include one board file into another, The two main procedures used to do this are \fs18\f3 load_generic_config\fs20\f1 and \fs18\f3 load_base_board_description\fs20\f1 . The generic config file contains other procedures used for a certain class of target. The board description file is where the board specfic settings go. Commonly there are similar target environments with just different processors.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 5-6. Testing a New Board Config File\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 make check RUNTESTFLAGS="--target_board=\i newboardfile\i0 ".\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 Here's an example of a board config file. There are several \i helper procedures\i0 used in this example. A helper procedure is one that look for a tool of files in commonly installed locations. These are mostly used when testing in the build tree, because the executables to be tested are in the same tree as the new dejagnu files. The helper procedures are the ones in square braces \i []\i0 , which is the Tcl execution characters.\hyphpar0\par\pard\sb200\li960\sl220\qj \b\lang1024 Example 5-7. Example Board Config File\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 \sa0\par\fi0\sb0
# Load the generic configuration for this board. This will define a basic\sa0\par\fi0\sb0
# set of routines needed by the tool to communicate with the board.\sa0\par\fi0\sb0
load_generic_config "sim"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# basic-sim.exp is a basic description for the standard Cygnus simulator.\sa0\par\fi0\sb0
load_base_board_description "basic-sim"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# The compiler used to build for this board. This has *nothing* to do\sa0\par\fi0\sb0
# with what compiler is tested if we're testing gcc.\sa0\par\fi0\sb0
set_board_info compiler "[find_gcc]"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# We only support newlib on this target.\sa0\par\fi0\sb0
# However, we include libgloss so we can find the linker scripts.\sa0\par\fi0\sb0
set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"\sa0\par\fi0\sb0
set_board_info ldflags "[newlib_link_flags]"\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# No linker script for this board.\sa0\par\fi0\sb0
set_board_info ldscript "-Tsim.ld";\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# The simulator doesn't return exit statuses and we need to indicate this.\sa0\par\fi0\sb0
set_board_info needs_status_wrapper 1\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# Can't pass arguments to this target.\sa0\par\fi0\sb0
set_board_info noargs 1\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# No signals.\sa0\par\fi0\sb0
set_board_info gdb,nosignals 1\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
# And it can't call functions.\sa0\par\fi0\sb0
set_board_info gdb,cannot_call_functions 1\sa0\par\fi0\sb0
\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_BOARDDEFS}{\*\bkmkend ID_BOARDDEFS}\b\fs24\f2 Board Config File Values\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 These fields are all in the board_info These are all set by using the \fs18\f3 set_board_info\fs20\f1 procedure. The parameters are the field name, followed by the value to set the field to.\hyphpar0\par\pard\sb200\li960\sl220\qj \b Table 5-1. Common Board Info Fields\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 Field\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 Sample Value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 compiler\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "[find_gcc]"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The path to the compiler to use.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 cflags\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "-mca"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Compilation flags for the compiler.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 ldflags\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "[libgloss_link_flags] [newlib_link_flags]"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Linking flags for the compiler.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 ldscript\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "-Wl,-Tidt.ld"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The linker script to use when cross compiling.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 libs\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "-lgcc"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Any additional libraries to link in.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 shell_prompt\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "cygmon>"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The command prompt of the remote shell.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 hex_startaddr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "0xa0020000"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The Starting address as a string.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 start_addr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 0xa0008000\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The starting address as a value.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 startaddr\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "a0020000"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 exit_statuses_bad\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Whether there is an accurate exit status.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 reboot_delay\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 10\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The delay between power off and power on.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 unreliable\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Whether communication with the board is unreliable.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 sim\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 [find_sim]\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The path to the simulator to use.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 objcopy\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 $tempfil\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The path to the \b objcopy\b0 program.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 support_libs\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "$\{prefix_dir\}/i386-coff/"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Support libraries needed for cross compiling.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 addl_link_flags\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "-N"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Additional link flags, rarely used.\sa60\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 \hyphpar0\par\pard\sb100\li960\sl220\qj These fields are used by the GCC and GDB tests, and are mostly only useful to somewhat trying to debug a new board file for one of these tools. Many of these are used only by a few testcases, and their purpose is esoteric. These are listed with sample values as a guide to better guessing if you need to change any of these.\hyphpar0\par\pard\sb200\li960\sl220\qj \b Table 5-2. Board Info Fields For GCC & GDB\sa100\keepn\par\trowd\trleft960\trhdr \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 Field\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 Sample Value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \b\fs20\lang1033\f2 Description\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 strip\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 $tempfile\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Strip the executable of symbols.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_load_offset\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "0x40050000"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_protocol\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "remote"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The GDB debugging protocol to use.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_sect_offset\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "0x41000000";\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_stub_ldscript\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "-Wl,-Teva-stub.ld"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The linker script to use with a GDB stub.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_init_command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "set mipsfpu none"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb,cannot_call_functions\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Whether GDB can call functions on the target,\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb,noargs\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Whether the target can take command line arguments.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb,nosignals\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Whether there are signals on the target.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb,short_int\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb,start_symbol\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "_start";\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The starting symbol in the executable.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb,target_sim_options\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "-sparclite"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Special options to pass to the simulator.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb,timeout\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 540\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Timeout value to use for remote communication.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_init_command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "print/x \\$fsr = 0x0"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_load_offset\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "0x12020000"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_opts\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "--command gdbinit"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_prompt\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "\\\\(gdb960\\\\)"\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 The prompt GDB is using.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_run_command\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "jump start"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gdb_stub_offset\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "0x12010000"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 use_gdb_stub\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Whether to use a GDB stub.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 use_vma_offset\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 wrap_m68k_aout\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gcc,no_label_values\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gcc,no_trampolines\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gcc,no_varargs\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 gcc,stack_size\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 16384\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 Stack size to use with some GCC testcases.\sa60\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 ieee_multilib_flags\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "-mieee";\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 is_simulator\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 needs_status_wrapper\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 no_double\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 no_long_long\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 noargs\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 1\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 nullstone,lib\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 "mips-clock.c"\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 nullstone,ticks_per_sec\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 3782018\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 sys_speed_value\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 200\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \trowd\trleft960 \clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrl\brdrs\brdrw20\cellx3440\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\cellx5920\clvertalt\clbrdrt\brdrs\brdrw20\clbrdrb\brdrs\brdrw20\clbrdrr\brdrs\brdrw20\cellx8400 \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 target_install\sa60\cell \plain \pard\intbl\sb60\li40\ri100\sl220 \fs20\lang1033\f1 \{sh-hms\}\sa60\cell \plain \pard\intbl\sl-120\par\cell \row \pard\plain\sl-1\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 \hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_WRITING}{\*\bkmkend ID_WRITING}\b\fs24\lang1024\f2 Writing A Test Case\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 The easiest way to prepare a new test case is to base it on an existing one for a similar situation. There are two major categories of tests: batch or interactive. Batch oriented tests are usually easier to write.\hyphpar0\par\pard\sb100\li960\sl220\qj The GCC tests are a good example of batch oriented tests. All GCC tests consist primarily of a call to a single common procedure, Since all the tests either have no output, or only have a few warning messages when successfully compiled. Any non-warning output is a test failure. All the C code needed is kept in the test directory. The test driver, written in Tcl, need only get a listing of all the C files in the directory, and compile them all using a generic procedure. This procedure and a few others supporting for these tests are kept in the library module \fs18\f3 lib/c-torture.exp\fs20\f1 in the GCC test suite. Most tests of this kind use very few expect features, and are coded almost purely in Tcl.\hyphpar0\par\pard\sb100\li960\sl220\qj Writing the complete suite of C tests, then, consisted of these steps:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Copying all the C code into the test directory. These tests were based on the C-torture test created by Torbjorn Granlund (on behalf of the Free Software Foundation) for GCC development.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Writing (and debugging) the generic Tcl procedures for compilation.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Writing the simple test driver: its main task is to search the directory (using the Tcl procedure \i glob\i0 for filename expansion with wildcards) and call a Tcl procedure with each filename. It also checks for a few errors from the testing procedure.\hyphpar0\par\pard\sb100\li960\sl220\qj \lang1033 Testing interactive programs is intrinsically more complex. Tests for most interactive programs require some trial and error before they are complete.\hyphpar0\par\pard\sb100\li960\sl220\qj However, some interactive programs can be tested in a simple fashion reminiscent of batch tests. For example, prior to the creation of DejaGnu, the GDB distribution already included a wide-ranging testing procedure. This procedure was very robust, and had already undergone much more debugging and error checking than many recent DejaGnu test cases. Accordingly, the best approach was simply to encapsulate the existing GDB tests, for reporting purposes. Thereafter, new GDB tests built up a family of Tcl procedures specialized for GDB testing.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_DEBUGGING}{\*\bkmkend ID_DEBUGGING}\b\fs24\lang1024\f2 Debugging A Test Case\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 These are the kinds of debugging information available from DejaGnu:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Output controlled by test scripts themselves, explicitly allowed for by the test author. This kind of debugging output appears in the detailed output recorded in the DejaGnu log file. To do the same for new tests, use the \b verbose\b0 procedure (which in turn uses the variable also called \i verbose\i0 ) to control how much output to generate. This will make it easier for other people running the test to debug it if necessary. Whenever possible, if \i $verbose\i0 is \i 0\i0 , there should be no output other than the output from \i pass\i0 , \i fail\i0 , \i error\i0 , and \i warning\i0 . Then, to whatever extent is appropriate for the particular test, allow successively higher values of \i $verbose\i0 to generate more information. Be kind to other programmers who use your tests: provide for a lot of debugging information.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Output from the internal debugging functions of Tcl and Expect. There is a command line options for each; both forms of debugging output are recorded in the file \fs18\f3 dbg.log\fs20\f1 in the current directory.\hyphpar0\par\pard\sb100\li1160\sl220\qj \lang1033 Use \fs18\f3 --debug\fs20\f1 for information from the expect level; it generates displays of the expect attempts to match the tool output with the patterns specified. This output can be very helpful while developing test scripts, since it shows precisely the characters received. Iterating between the latest attempt at a new test script and the corresponding \fs18\f3 dbg.log\fs20\f1 can allow you to create the final patterns by ``cut and paste''. This is sometimes the best way to write a test case.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Use \fs18\f3 --strace\fs20\f1 to see more detail at the Tcl level; this shows how Tcl procedure definitions expand, as they execute. The associated number controls the depth of definitions expanded.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Finally, if the value of \i verbose\i0 is 3 or greater,DejaGnu turns on the expect command \b log_user\b0 . This command prints all expect actions to the expect standard output, to the detailed log file, and (if \fs18\f3 --debug\fs20\f1 is on) to \fs18\f3 dbg.log\fs20\f1 .\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_ADDING}{\*\bkmkend ID_ADDING}\b\fs24\f2 Adding A Test Case To A Testsuite.\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 There are two slightly different ways to add a test case. One is to add the test case to an existing directory. The other is to create a new directory to hold your test. The existing test directories represent several styles of testing, all of which are slightly different; examine the directories for the tool of interest to see which (if any) is most suitable.\hyphpar0\par\pard\sb100\li960\sl220\qj Adding a GCC test can be very simple: just add the C code to any directory beginning with \fs18\f3 gcc\fs20\f1 . and it runs on the next \hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\f3 runtest --tool\sa0\par\fi0\sb0
gcc\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 .\hyphpar0\par\pard\sb100\li960\sl220\qj To add a test to GDB, first add any source code you will need to the test directory. Then you can either create a new expect file, or add your test to an existing one (any file with a \i .exp\i0 suffix). Creating a new .exp file is probably a better idea if the test is significantly different from existing tests. Adding it as a separate file also makes upgrading easier. If the C code has to be already compiled before the test will run, then you'll have to add it to the \fs18\f3 Makefile.in\fs20\f1 file for that test directory, then run \b configure\b0 and \b make\b0 .\hyphpar0\par\pard\sb100\li960\sl220\qj Adding a test by creating a new directory is very similar:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Create the new directory. All subdirectory names begin with the name of the tool to test; e.g. G++ tests might be in a directory called \fs18\f3 g++.other\fs20\f1 . There can be multiple test directories that start with the same tool name (such as \i g++\i0 ).\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Add the new directory name to the configdirs definition in the \fs18\f3 configure.in\fs20\f1 file for the testsuite directory. This way when \b make\b0 and \b configure\b0 next run, they include the new directory.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Add the new test case to the directory, as above. \hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 To add support in the new directory for configure and make, you must also create a \fs18\f3 Makefile.in\fs20\f1 and a \fs18\f3 configure.in\fs20\f1 .\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_HINTS}{\*\bkmkend ID_HINTS}\b\fs24\f2 Hints On Writing A Test Case\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 It is safest to write patterns that match all the output generated by the tested program; this is called closure. If a pattern does not match the entire output, any output that remains will be examined by the next \b expect\b0 command. In this situation, the precise boundary that determines which \b expect\b0 command sees what is very sensitive to timing between the Expect task and the task running the tested tool. As a result, the test may sometimes appear to work, but is likely to have unpredictable results. (This problem is particularly likely for interactive tools, but can also affect batch tools---especially for tests that take a long time to finish.) The best way to ensure closure is to use the \fs18\f3 -re\fs20\f1 option for the \b expect\b0 command to write the pattern as a full regular expressions; then you can match the end of output using a \i $\i0 . It is also a good idea to write patterns that match all available output by using \i .*\\\i0 after the text of interest; this will also match any intervening blank lines. Sometimes an alternative is to match end of line using \i \\r\i0 or \i \\n\i0 , but this is usually too dependent on terminal settings.\hyphpar0\par\pard\sb100\li960\sl220\qj Always escape punctuation, such as \i (\i0 or \i "\i0 , in your patterns; for example, write \i \\(\i0 . If you forget to escape punctuation, you will usually see an error message like \hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\f3 extra\sa0\par\fi0\sb0
characters after close-quote.\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 If you have trouble understanding why a pattern does not match the program output, try using the \fs18\f3 --debug\fs20\f1 option to \b runtest\b0 , and examine the debug log carefully.\hyphpar0\par\pard\sb100\li960\sl220\qj Be careful not to neglect output generated by setup rather than by the interesting parts of a test case. For example, while testing GDB, I issue a send \i set height 0\\n\i0 command. The purpose is simply to make sure GDB never calls a paging program. The \i set height\i0 command in GDB does not generate any output; but running any command makes GDB issue a new \i (gdb) \i0 prompt. If there were no \b expect\b0 command to match this prompt, the output \i (gdb) \i0 begins the text seen by the next \b expect\b0 command---which might make that pattern fail to match.\hyphpar0\par\pard\sb100\li960\sl220\qj To preserve basic sanity, I also recommended that no test ever pass if there was any kind of problem in the test case. To take an extreme case, tests that pass even when the tool will not spawn are misleading. Ideally, a test in this sort of situation should not fail either. Instead, print an error message by calling one of the DejaGnu procedures \b error\b0 or \b warning\b0 .\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_TVARIABLES}{\*\bkmkend ID_TVARIABLES}\b\fs24\lang1024\f2 Special variables used by test cases.\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 There are special variables used by test cases. These contain other information from DejaGnu. Your test cases can use these variables, with conventional meanings (as well as the variables saved in \fs18\f3 site.exp\fs20\f1 . You can use the value of these variables, but they should never be changed.\hyphpar0\par\pard\sb200\sl220\qj \lang1024 $prms_id\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The tracking system (e.g. GNATS) number identifying a corresponding bugreport. (\i 0\i0 \} if you do not specify it in the test script.)\hyphpar0\par\pard\sb200\sl220\qj $item bug_id\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab An optional bug id; may reflect a bug identification from another organization. (\i 0\i0 if you do not specify it.)\hyphpar0\par\pard\sb200\sl220\qj $subdir\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The subdirectory for the current test case.\hyphpar0\par\pard\sb200\sl220\qj $expect_out(buffer)\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab The output from the last command. This is an internal variable set by Expect. More information can be found in the Expect manual.\hyphpar0\par\pard\sb200\sl220\qj $exec_output\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab This is the output from a \fs18\f3 $\{tool\}_load\fs20\f1 command. This only applies to tools like GCC and GAS which produce an object file that must in turn be executed to complete a test.\hyphpar0\par\pard\sb200\sl220\qj $comp_output\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \~\tab This is the output from a \fs18\f3 $\{tool\}_start\fs20\f1 command. This is conventionally used for batch oriented programs, like GCC and GAS, that may produce interesting output (warnings, errors) without further interaction.\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 6. Unit Testing}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 6. Unit Testing}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_UNIT}{\*\bkmkend ID_UNIT}\b\fs29\f2 Chapter 6. Unit Testing\keepn\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_UNITTEST}{\*\bkmkend ID_UNITTEST}\fs24 What Is Unit Testing ?\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Most regression testing as done by DejaGnu is system testing. This is the complete application is tested all at once. Unit testing is for testing single files, or small libraries. In this case, each file is linked with a test case in C or C++, and each function or class and method is tested in series, with the test case having to check private data or global variables to see if the function or method worked.\hyphpar0\par\pard\sb100\li960\sl220\qj This works particularly well for testing APIs and at level where it is easier to debug them, than by needing to trace through the entire appication. Also if there is a specification for the API to be tested, the testcase can also function as a compliance test.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_DJH}{\*\bkmkend ID_DJH}\b\fs24\lang1024\f2 The dejagnu.h Header File\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu uses a single header file to assist in unit testing. As this file also produces it's one test state output, it can be run standalone, which is very useful for testing on embedded systems. This header file has a C and C++ API for the test states, with simple totals, and standardized output. Because the output has been standardized, DejaGnu can be made to work with this test case, without writing almost any Tcl. The library module, dejagnu.exp, will look for the output messages, and then merge them into DejaGnu's.\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 7. Reference}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 7. Reference}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_REFERENCE}{\*\bkmkend ID_REFERENCE}\b\fs29\f2 Chapter 7. Reference\keepn\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_OBTAINING}{\*\bkmkend ID_OBTAINING}\fs24 Obtaining DejaGnu\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 You can obtain DejaGnu from the DejaGnu web site at the Free Software Foundation\up8\fs12 1\up0\fs20 , which is at www.gnu.org/software/dejagnu/ \up8\fs12 2\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_INSTALLATION}{\*\bkmkend ID_INSTALLATION}\b\up0\fs24\lang1024\f2 Installation\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 Once you have the DejaGnu source unpacked and available, you must first configure the software to specify where it is to run (and the associated defaults); then you can proceed to installing it.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_CONFIGURING}{\*\bkmkend ID_CONFIGURING}\b\fs22\lang1024\f2 Configuring DejaGnu\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 It is usually best to configure in a directory separate from the source tree, specifying where to find the source with the optional \i --srcdir\i0 option to \i configure\i0 . DejaGnu uses the GNU \i autoconf\i0 to configure itself. For more info on using autoconf, read the GNU autoconf manual. To configure, execute the \fs18\f3 configure\fs20\f1 program, no other options are required. For an example, to configure in a seperate tree for objects, execute the configure script from the source tree like this:\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 ../dejagnu-1.4.4/configure\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 DejaGnu doesn't care at config time if it's for testing a native system or a cross system. That is determined at runtime by using the config files.\hyphpar0\par\pard\sb100\li960\sl220\qj You may also want to use the \b configure\b0 option \i --prefix\i0 to specify where you want DejaGnu and its supporting code installed. By default, installation is in subdirectories of \fs18\f3 /usr/local\fs20\f1 , but you can select any alternate directory altdir by including \fs18\f3 --prefix\fs20\f1 \{altdir\}\} on the \b configure\b0 command line. (This value is captured in the Makefile variables \i prefix\i0 and \i exec\i0 prefix\}.)\hyphpar0\par\pard\sb100\li960\sl220\qj Save for a small number of example tests, the DejaGnu distribution itself does not include any testsuites; these are available separately. Testsuites for the GNU development tools are included in those releases. After configuring the top-level DejaGnu directory, unpack and configure the test directories for the tools you want to test; then, in each test directory, run \i make check\i0 to build auxiliary programs required by some of the tests, and run the test suites.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_INSTALLING}{\*\bkmkend ID_INSTALLING}\b\fs22\lang1024\f2 Installing DejaGnu\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 To install DejaGnu in your filesystem (either in \fs18\f3 /usr/local\fs20\f1 , or as specified by your \i --prefix\i0 option to \i configure\i0 ), execute.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\lang1024\f3 eg$ make install\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \i\fs20\lang1033\f1 make install\i0 does thes things for DejaGnu:\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 Look in the path specified for executables $exec_prefix) for directories called \fs18\f3 lib\fs20\f1 and \fs18\f3 bin\fs20\f1 . If these directories do not exist, \i make install\i0 creates them.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Create another directory in the \fs18\f3 share\fs20\f1 directory, called \fs18\f3 dejagnu\fs20\f1 , and copy all the library files into it.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Create a directory in the \fs18\f3 dejagnu/share\fs20\f1 directory, called \fs18\f3 config\fs20\f1 , and copy all the configuration files into it.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Copy the \i runtest\i0 shell script into \fs18\f3 $exec_prefix/bin\fs20\f1 .\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 Copy \fs18\f3 runtest.exp\fs20\f1 into \fs18\f3 $exec_prefix/lib/dejagnu\fs20\f1 . This is the main Tcl code implementing DejaGnu.\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_BUILTINS}{\*\bkmkend ID_BUILTINS}\b\fs24\f2 Builtin Procedures\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 DejaGnu provides these Tcl procedures.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_COREPROCS}{\*\bkmkend ID_COREPROCS}\b\fs22\lang1024\f2 Core Internal Procedures\keepn\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_MAILFILE}{\*\bkmkend ID_MAILFILE}\fs20 Mail_file Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 mail_file\fs18 (\i file to subject\i0 );\keepn\hyphpar0\par\pard\sb200\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_OPENLOGS}{\*\bkmkend ID_OPENLOGS}\b\f2 Open_logs Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 open_logs\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_CLOSELOGS}{\*\bkmkend ID_CLOSELOGS}\b\fs20\f2 Close_logs Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 close_logs\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_ISBUILD}{\*\bkmkend ID_ISBUILD}\b\fs20\f2 Isbuild Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Tests for a particular build host environment. If the currently configured host matches the argument string, the result is \i 1\i0 ; otherwise the result is \i 0\i0 . \i host\i0 must be a full three-part configure host name; in particular, you may not use the shorter nicknames supported by configure (but you can use wildcard characters, using shell syntax, to specify sets of names). If it is passed a NULL string, then it returns the name of the build canonical configuration.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 isbuild\fs18 (\i pattern\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 pattern\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_ISREMOTE}{\*\bkmkend ID_ISREMOTE}\b\f2 Is_remote Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 is_remote\fs18 (\i board\i0 );\keepn\hyphpar0\par\pard\sb200\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_IS3WAY}{\*\bkmkend ID_IS3WAY}\b\f2 is3way Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Tests for a canadian cross. This is when the tests will be run on a remotly hosted cross compiler. If it is a canadian cross, then the result is \i 1\i0 ; otherwise the result is \i 0\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 is3way\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_ISHOST}{\*\bkmkend ID_ISHOST}\b\fs20\f2 Ishost Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Tests for a particular host environment. If the currently configured host matches the argument string, the result is \i 1\i0 ; otherwise the result is \i 0\i0 . \i host\i0 must be a full three-part configure host name; in particular, you may not use the shorter nicknames supported by configure (but you can use wildcard characters, using shell syntax, to specify sets of names).\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 ishost\fs18 (\i pattern\i0 );\keepn\hyphpar0\par\pard\sb200\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_ISTARGET}{\*\bkmkend ID_ISTARGET}\b\f2 Istarget Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Tests for a particular target environment. If the currently configured target matches the argument string, the result is \i 1\i0 ; otherwise the result is \i 0\i0 . target must be a full three-part configure target name; in particular, you may not use the shorter nicknames supported by configure (but you can use wildcard characters, using shell syntax, to specify sets of names). If it is passed a \i NULL\i0 string, then it returns the name of the build canonical configuration.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 istarget\fs18 (\i args\i0 );\keepn\hyphpar0\par\pard\sb200\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_ISNATIVE}{\*\bkmkend ID_ISNATIVE}\b\f2 Isnative Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Tests whether the current configuration has the same host and target. When it runs in a native configuration this procedure returns a \i 1\i0 ; otherwise it returns a \i 0\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 isnative\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_UNKNOWN}{\*\bkmkend ID_UNKNOWN}\b\fs20\f2 Unknown Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 unknown\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_CLONEOUTPUT}{\*\bkmkend ID_CLONEOUTPUT}\b\f2 Clone_output Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 clone_output\fs18 (\i message\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 message\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RESETVARS}{\*\bkmkend ID_RESETVARS}\b\f2 Reset_vars Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 reset_vars\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LOGANDEXIT}{\*\bkmkend ID_LOGANDEXIT}\b\fs20\f2 Log_and_exit Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 log_and_exit\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LOGSUMMARY}{\*\bkmkend ID_LOGSUMMARY}\b\fs20\f2 Log_summary Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 log_summary\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_CLEANUP}{\*\bkmkend ID_CLEANUP}\b\f2 Cleanup Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 cleanup\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_SETUPXFAIL}{\*\bkmkend ID_SETUPXFAIL}\b\fs20\f2 Setup_xfail Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares that the test is expected to fail on a particular set of configurations. The config argument must be a list of full three-part configure target name; in particular, you may not use the shorter nicknames supported by configure (but you can use the common shell wildcard characters to specify sets of names). The \i bugid\i0 argument is optional, and used only in the logging file output; use it as a link to a bug-tracking system such as GNATS.\hyphpar0\par\pard\sb100\li960\sl220\qj Once you use \fs18\f3 setup_xfail\fs20\f1 , the \fs18\f3 fail\fs20\f1 and \fs18\f3 pass\fs20\f1 procedures produce the messages \i XFAIL\i0 and \i XPASS\i0 respectively, allowing you to distinguish expected failures (and unexpected success!) from other test outcomes.\hyphpar0\par\pard\sb200\brdrt\brdrs\brdrw10\brsp100\li1600\ri200\brdrl\brdrs\brdrw10\brsp200\li1600\ri200\brdrb\brdrs\brdrw10\brsp0\li1600\ri200\brdrr\brdrs\brdrw10\brsp200\li1600\ri200\sl266\qc \b\fs24\lang1024\f2 Warning\keepn\hyphpar0\par\pard\sb100\brdrt\brdrs\brdrw10\brsp100\li1600\ri200\brdrl\brdrs\brdrw10\brsp200\li1600\ri200\brdrb\brdrs\brdrw10\brsp0\li1600\ri200\brdrr\brdrs\brdrw10\brsp200\li1600\ri200\sl198\qj \b0\fs18\lang1033\f4 Warning you must clear the expected failure after using setup_xfail in a test case. Any call to \fs16\f3 pass \fs18\f4 or \fs16\f3 fail\fs18\f4 l clears the expected failure implicitly; if the test has some other outcome, e.g. an error, you can call \fs16\f3 clear_xfail\fs18\f4 to clear the expected failure explicitly. Otherwise, the expected-failure declaration applies to whatever test runs next, leading to surprising results.\keepn\hyphpar0\par\pard\brdrt\brdrs\brdrw10\brsp100\li1600\ri200\brdrl\brdrs\brdrw10\brsp200\li1600\ri200\brdrb\brdrs\brdrw10\brsp0\li1600\ri200\brdrr\brdrs\brdrw10\brsp200\li1600\ri200\sl-100\keepn\par\pard\sl-1\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 setup_xfail\fs18 (\i config\i0 \i bugid\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 config\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The config triplet to trigger whether this is an unexpected or expect failure.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 bugid\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The optional bugid, used to tie it this test case to a bug tracking system.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RECORDTEST}{\*\bkmkend ID_RECORDTEST}\b\f2 Record_test Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 record_test\fs18 (\i type\i0 \i message\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 type\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 message\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PASS}{\*\bkmkend ID_PASS}\b\f2 Pass Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares a test to have passed. \fs18\f3 pass\fs20\f1 writes in the log files a message beginning with \i PASS\i0 (or \i XPASS\i0 , if failure was expected), appending the argument \i\f3 string\i0\f1 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 pass\fs18 (\i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The string to use for this PASS message.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FAIL}{\*\bkmkend ID_FAIL}\b\f2 Fail Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares a test to have failed. \fs18\f3 fail\fs20\f1 writes in the log files a message beginning with \i FAIL\i0 (or \i XFAIL\i0 , if failure was expected), appending the argument \i\f3 string\i0\f1 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 fail\fs18 (\i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The string to use for this FAIL message.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_XPASS}{\*\bkmkend ID_XPASS}\b\f2 Xpass Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares a test to have unexpectably passed, when it was expected to be a failure. \fs18\f3 xpass\fs20\f1 writes in the log files a message beginning with \i XPASS\i0 (or \i XFAIL\i0 , if failure was expected), appending the argument \i\f3 string\i0\f1 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 xpass\fs18 (\i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The string to use for this output state.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_XFAIL}{\*\bkmkend ID_XFAIL}\b\f2 Xfail Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares a test to have expectably failed. \fs18\f3 xfail\fs20\f1 writes in the log files a message beginning with \i XFAIL\i0 (or \i PASS\i0 , if success was expected), appending the argument \i\f3 string\i0\f1 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 xpass\fs18 (\i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The string to use for this output state.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_SETWARNINGTHRESHOLD}{\*\bkmkend ID_SETWARNINGTHRESHOLD}\b\f2 Set_warning_threshold Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Sets the value of warning_threshold. A value of \i 0\i0 disables it: calls to \fs18\f3 warning\fs20\f1 will not turn a \i PASS\i0 or \i FAIL\i0 into an \i UNRESOLVED\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 set_warning_threshold\fs18 (\i threshold\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 threshold\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This is the value of the new warning threshold.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_GETWARNINGTHRESHOLD}{\*\bkmkend ID_GETWARNINGTHRESHOLD}\b\f2 Get_warning_threshold Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Returns the current value of \{warning_threshold. The default value is 3. This value controls how many \fs18\f3 warning\fs20\f1 procedures can be called before becoming \i UNRESOLVED\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 get_warning_threshold\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WARNING}{\*\bkmkend ID_WARNING}\b\fs20\f2 Warning Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares detection of a minor error in the test case itself. \fs18\f3 warning\fs20\f1 writes in the log files a message beginning with \i WARNING\i0 , appending the argument \i\f3 string\i0\f1 . Use \fs18\f3 warning\fs20\f1 rather than \fs18\f3 perror\fs20\f1 for cases (such as communication failure to be followed by a retry) where the test case can recover from the error. If the optional \i\f3 number\i0\f1 is supplied, then this is used to set the internal count of warnings to that value.\hyphpar0\par\pard\sb100\li960\sl220\qj As a side effect, warning_threshold or more calls to warning in a single test case also changes the effect of the next \fs18\f3 pass\fs20\f1 or \fs18\f3 fail\fs20\f1 command: the test outcome becomes \i UNRESOLVED\i0 since an automatic \i PASS\i0 or \i FAIL\i0 may not be trustworthy after many warnings. If the optional numeric value is \i 0\i0 , then there are no further side effects to calling this function, and the following test outcome doesn't become \i UNRESOLVED\i0 . This can be used for errors with no known side effects.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 warning\fs18 (\i string\i0 \i number\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 number\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The optional number to set the error counter. Thius is only used to fake out the counter when using the \fs18\f3 xfail\fs20\f1 procedure to control when it flips the output over to \i UNRESOLVED\i0 state.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PERROR}{\*\bkmkend ID_PERROR}\b\f2 Perror Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares a severe error in the testing framework itself. \fs18\f3 perror\fs20\f1 writes in the log files a message beginning with \i ERROR\i0 , appending the argument \i\f3 string\i0\f1 .\hyphpar0\par\pard\sb100\li960\sl220\qj As a side effect, perror also changes the effect of the next \fs18\f3 pass\fs20\f1 or \fs18\f3 fail\fs20\f1 command: the test outcome becomes \i UNRESOLVED\i0 , since an automatic \i PASS\i0 or \i FAIL\i0 cannot be trusted after a severe error in the test framework. If the optional numeric value is \i 0\i0 , then there are no further side effects to calling this function, and the following test outcome doesn't become \i UNRESOLVED\i0 . This can be used for errors with no known side effects.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 perror\fs18 (\i string\i0 \i number\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 number\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The optional number to set the error counter. Thius is only used to fake out the counter when using the \fs18\f3 xfail\fs20\f1 procedure to control when it flips the output over to \i UNRESOLVED\i0 state.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_NOTE}{\*\bkmkend ID_NOTE}\b\f2 Note Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Appends an informational message to the log file. \fs18\f3 note\fs20\f1 writes in the log files a message beginning with \i NOTE\i0 , appending the argument \i\f3 string\i0\f1 . Use \fs18\f3 note\fs20\f1 sparingly. The \fs18\f3 verbose\fs20\f1 should be used for most such messages, but in cases where a message is needed in the log file regardless of the verbosity level use \fs18\f3 note\fs20\f1 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 note\fs18 (\i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The string to use for this note.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_UNTESTED}{\*\bkmkend ID_UNTESTED}\b\f2 Untested Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares a test was not run. \fs18\f3 untested\fs20\f1 writes in the log file a message beginning with \i UNTESTED\i0 , appending the argument \i string\i0 . For example, you might use this in a dummy test whose only role is to record that a test does not yet exist for some feature.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 untested\fs18 (\i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The string to use for this output state.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_UNRESOLVED}{\*\bkmkend ID_UNRESOLVED}\b\f2 Unresolved Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares a test to have an unresolved outcome. \fs18\f3 unresolved\fs20\f1 writes in the log file a message beginning with \i UNRESOLVED\i0 , appending the argument \i string\i0 . This usually means the test did not execute as expected, and a human being must go over results to determine if it passed or failed (and to improve the test case).\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 unresolved\fs18 (\i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The string to use for this output state.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_UNSUPPORTED}{\*\bkmkend ID_UNSUPPORTED}\b\f2 Unsupported Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Declares that a test case depends on some facility that does not exist in the testing environment. \fs18\f3 unsupported\fs20\f1 writes in the log file a message beginning with \i UNSUPPORTED\i0 , appending the argument string.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 unsupported\fs18 (\i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The string to use for this output state.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_INITTESTCOUNTS}{\*\bkmkend ID_INITTESTCOUNTS}\b\f2 Init_testcounts Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 init_testcounts\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_INCRCOUNT}{\*\bkmkend ID_INCRCOUNT}\b\fs20\f2 Incr_count Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 incr_count\fs18 (\i name\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 name\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TRANSFORM}{\*\bkmkend ID_TRANSFORM}\b\f2 transform Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Generates a string for the name of a tool as it was configured and installed, given its native name (as the argument \i\f3 toolname\i0\f1 ). This makes the assumption that all tools are installed using the same naming conventions: For example, for a cross compiler supporting the \i m68k-vxworks\i0 configuration, the result of transform \b gcc\b0 is \b m68k-vxworks-gcc\b0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 transform\fs18 (\i toolname\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 toolname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The name of the cross-development program to transform.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_CHECKCONDITIONALXFAIL}{\*\bkmkend ID_CHECKCONDITIONALXFAIL}\b\f2 Check_conditional_xfail Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This procedure adds a conditional xfail, based on compiler options used to create a test case executable. If an include options is found in the compiler flags, and it's the right architecture, it'll trigger an \i XFAIL\i0 . Otherwise it'll produce an ordinary \i FAIL\i0 . You can also specify flags to exclude. This makes a result be a \i FAIL\i0 , even if the included options are found. To set the conditional, set the variable compiler_conditional_xfail_data to the fields \hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\f3 "[message string] [targets list] [includes\sa0\par\fi0\sb0
list] [excludes list]"\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 (descriptions below). This is the checked at pass/fail decision time, so there is no need to call the procedure yourself, unless you wish to know if it gets triggered. After a pass/fail, the variable is reset, so it doesn't effect other tests. It returns \i 1\i0 if the conditional is true, or \i 0\i0 if the conditional is false.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 check_conditional_xfail\fs18 (\i message\i0 \i targets\i0 \i includes\i0 \i excludes\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 message\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This is the message to print with the normal test result.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 targets\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This is a string with the list targets to activate this conditional on.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 includes\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This is a list of sets of options to search for in the compiler options to activate this conditional. If the list of sets of options is empty or if any set of the options matches, then this conditional is true. (It may be useful to specify an empty list of include sets if the conditional is always true unless one of the exclude sets matches.)\hyphpar0\par\pard\sb200\sl220\qj \i\f3 excludes\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This is a list of sets of options to search for in the compiler options to activate this conditional. If any set of the options matches, (regardless of whether any of the include sets match) then this conditional is de-activated.\hyphpar0\par\pard\sb200\li960\sl220\qj \b Example 7-1. Specifying the conditional xfail data\keepn\hyphpar0\par\pard\sb100\li960\sl198\qj \b0\fs18\f3 set compiler_conditional_xfail_data \{ \\\sa0\par\fi0\sb0
"I sure wish I knew why this was hosed" \\\sa0\par\fi0\sb0
"sparc*-sun*-* *-pc-*-*" \\\sa0\par\fi0\sb0
\{"-Wall -v" "-O3"\} \\\sa0\par\fi0\sb0
\{"-O1" "-Map"\} \\\sa0\par\fi0\sb0
\}\sa0\par\fi0\sb0
\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\lang1033\f1 What this does is it matches only for these two targets if "-Wall -v" or "-O3" is set, but neither "-O1" or "-Map" is set. For a set to match, the options specified are searched for independantly of each other, so a "-Wall -v" matches either "-Wall -v" or "-v -Wall". A space seperates the options in the string. Glob-style regular expressions are also permitted.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_CLEARXFAIL}{\*\bkmkend ID_CLEARXFAIL}\b\lang1024\f2 Clear_xfail Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Cancel an expected failure (previously declared with \b setup_xfail\b0 ) for a particular set of configurations. The \i\f3 config\i0\f1 argument is a list of configuration target names. It is only necessary to call \b clear_xfail\b0 if a test case ends without calling either \b pass\b0 or \b fail\b0 , after calling \b setup_xfail\b0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 clear_xfail\fs18 (\i config\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 config\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The configuration triplets to clear.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_VERBOSE}{\*\bkmkend ID_VERBOSE}\b\f2 Verbose Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Test cases can use this function to issue helpful messages depending on the number of \fs18\f3 --verbose\fs20\f1 options on the runtest command line. It prints string if the value of the variable verbose is higher than or equal to the optional number. The default value for number is \i 1\i0 . Use the optional \fs18\f3 -log\fs20\f1 argument to cause string to always be added to the log file, even if it won't be printed. Use the optional \fs18\f3 -x\fs20\f1 argument to log the test results into a parsable XML file. Use the optional \fs18\f3 -n\fs20\f1 argument to print string without a trailing newline. Use the optional \fs18\f3 --\fs20\f1 argument if string begins with "-".\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 verbose\fs18 (\i -log\i0 \i -x\i0 \i -n\i0 \i -r\i0 \i string\i0 \i number\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 -x\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 -log\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 -n\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 --\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 number\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LOADLIB}{\*\bkmkend ID_LOADLIB}\b\f2 Load_lib Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Loads a DejaGnu library file by searching a fixed path built into DejaGnu. If DejaGnu has been installed, it looks in a path starting with the installed library directory. If you are running DejaGnu directly from a source directory, without first running \b make install\b0 , this path defaults to the current directory. In either case, it then looks in the current directory for a directory called \fs18\f3 lib\fs20\f1 . If there are duplicate definitions, the last one loaded takes precedence over the earlier ones.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 load_lib\fs18 (\i filespec\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 filespec\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The name of the DejaGnu library file to load.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_REMOTEPROCS}{\*\bkmkend ID_REMOTEPROCS}\b\fs22\f2 Procedures For Remote Communication\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs18\lang1033\f3 lib/remote.exp\fs20\f1 defines these functions, for establishing and managing communications. Each of these procedures tries to establish the connection up to three times before returning. Warnings (if retries will continue) or errors (if the attempt is abandoned) report on communication failures. The result for any of these procedures is either \i -1\i0 , when the connection cannot be established, or the spawn ID returned by the Expect command \b spawn\b0 .\hyphpar0\par\pard\sb100\li960\sl220\qj It use the value of the connect field in the target_info array (was connectmode as the type of connection to make. Current supported connection types are tip, kermit, telnet, rsh, rlogin, and netdata. If the \fs18\f3 --reboot\fs20\f1 option was used on the runtest command line, then the target is rebooted before the connection is made.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_CALLREMOTE}{\*\bkmkend ID_CALLREMOTE}\b\lang1024\f2 Call_remote Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 call_remote\fs18 (\i type\i0 \i proc\i0 \i dest\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 proc\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_CHECKFORBOARDSTATUS}{\*\bkmkend ID_CHECKFORBOARDSTATUS}\b\f2 Check_for_board_status Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 check_for_board_status\fs18 (\i variable\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 variable\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FILEONBUILD}{\*\bkmkend ID_FILEONBUILD}\b\f2 File_on_build Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 file_on_build\fs18 (\i op\i0 \i file\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 op\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FILEONHOST}{\*\bkmkend ID_FILEONHOST}\b\f2 File_on_host Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 file_on_host\fs18 (\i op\i0 \i file\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 op\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LOCALEXEC}{\*\bkmkend ID_LOCALEXEC}\b\f2 Local_exec Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 local_exec\fs18 (\i commandline\i0 \i inp\i0 \i outp\i0 \i timeout\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 inp\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 outp\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 timeout\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEBINARY}{\*\bkmkend ID_REMOTEBINARY}\b\f2 Remote_binary Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_binary\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTECLOSE}{\*\bkmkend ID_REMOTECLOSE}\b\f2 Remote_close Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_close\fs18 (\i shellid\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 shellid\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This is the value returned by a call to \fs18\f3 remote_open\fs20\f1 . This closes the connection to the target so resources can be used by others. This parameter can be left off if the fileid field in the target_info array is set.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEDOWNLOAD}{\*\bkmkend ID_REMOTEDOWNLOAD}\b\f2 Remote_download Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_download\fs18 (\i dest\i0 \i file\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEEXEC}{\*\bkmkend ID_REMOTEEXEC}\b\f2 Remote_exec Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_exec\fs18 (\i hostname\i0 \i program\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 hostname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 program\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEEXPECT}{\*\bkmkend ID_REMOTEEXPECT}\b\f2 Remote_expect Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_expect\fs18 (\i board\i0 \i timeout\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 board\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 timeout\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEFILE}{\*\bkmkend ID_REMOTEFILE}\b\f2 Remote_file Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_file\fs18 (\i dest\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTELD}{\*\bkmkend ID_REMOTELD}\b\f2 Remote_ld Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_ld\fs18 (\i dest\i0 \i prog\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 prog\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTELOAD}{\*\bkmkend ID_REMOTELOAD}\b\f2 Remote_load Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_load\fs18 (\i dest\i0 \i prog\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 prog\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEOPEN}{\*\bkmkend ID_REMOTEOPEN}\b\f2 Remote_open Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_open\fs18 (\i type\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 type\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This is passed \fs18\f3 host\fs20\f1 or \fs18\f3 target\fs20\f1 . Host or target refers to whether it is a connection to a remote target, or a remote host. This opens the connection to the desired target or host using the default values in the configuration system. It returns that spawn_id of the process that manages the connection. This value can be used in Expect or \b exp_send\b0 statements, or passed to other procedures that need the connection process's id. This also sets the fileid field in the target_info array.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEPOPCONN}{\*\bkmkend ID_REMOTEPOPCONN}\b\f2 Remote_pop_conn Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_pop_conn\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEPUSHCONN}{\*\bkmkend ID_REMOTEPUSHCONN}\b\f2 Remote_push_conn Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_push_conn\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWBINARY}{\*\bkmkend ID_REMOTERAWBINARY}\b\f2 Remote_raw_binary Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_binary\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWCLOSE}{\*\bkmkend ID_REMOTERAWCLOSE}\b\f2 Remote_raw_close Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_close\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWFILE}{\*\bkmkend ID_REMOTERAWFILE}\b\f2 Remote_raw_file Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_file\fs18 (\i dest\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWLD}{\*\bkmkend ID_REMOTERAWLD}\b\f2 remote_raw_ld Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_ld\fs18 (\i dest\i0 \i prog\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 prog\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWLOAD}{\*\bkmkend ID_REMOTERAWLOAD}\b\f2 Remote_raw_load Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_load\fs18 (\i dest\i0 \i prog\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 prog\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWOPEN}{\*\bkmkend ID_REMOTERAWOPEN}\b\f2 Remote_raw_open Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_open\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWSEND}{\*\bkmkend ID_REMOTERAWSEND}\b\f2 Remote_raw_send Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_send\fs18 (\i dest\i0 \i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWSPAWN}{\*\bkmkend ID_REMOTERAWSPAWN}\b\f2 Remote_raw_spawn Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_spawn\fs18 (\i dest\i0 \i commandline\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 commandline\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWTRANSMIT}{\*\bkmkend ID_REMOTERAWTRANSMIT}\b\f2 Remote_raw_transmit Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_transmit\fs18 (\i dest\i0 \i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTERAWWAIT}{\*\bkmkend ID_REMOTERAWWAIT}\b\f2 Remote_raw_wait Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_raw_wait\fs18 (\i dest\i0 \i timeout\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 timeout\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEREBOOT}{\*\bkmkend ID_REMOTEREBOOT}\b\f2 Remote_reboot Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_reboot\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTESEND}{\*\bkmkend ID_REMOTESEND}\b\f2 Remote_send Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_send\fs18 (\i dest\i0 \i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTESPAWN}{\*\bkmkend ID_REMOTESPAWN}\b\f2 Remote_spawn Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_spawn\fs18 (\i dest\i0 \i commandline\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 commandline\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTESWAPCONN}{\*\bkmkend ID_REMOTESWAPCONN}\b\f2 Remote_swap_conn Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_swap_conn\fs18 (\i host\i0 );\keepn\hyphpar0\par\pard\sb200\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTETRANSMIT}{\*\bkmkend ID_REMOTETRANSMIT}\b\f2 Remote_transmit Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_transmit\fs18 (\i dest\i0 \i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEUPLOAD}{\*\bkmkend ID_REMOTEUPLOAD}\b\f2 Remote_upload Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_upload\fs18 (\i dest\i0 \i srcfile\i0 \i arg\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 srcfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 arg\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REMOTEWAIT}{\*\bkmkend ID_REMOTEWAIT}\b\f2 Remote_wait Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 remote_wait\fs18 (\i dest\i0 \i timeout\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 timeout\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDCLOSE}{\*\bkmkend ID_STANDARDCLOSE}\b\f2 Standard_close Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_close\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDDOWNLOAD}{\*\bkmkend ID_STANDARDDOWNLOAD}\b\f2 Standard_download Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_download\fs18 (\i dest\i0 \i file\i0 \i destfile\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDEXEC}{\*\bkmkend ID_STANDARDEXEC}\b\f2 Standard_exec Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_exec\fs18 (\i hostname\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 hostname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDFILE}{\*\bkmkend ID_STANDARDFILE}\b\f2 Standard_file Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_file\fs18 (\i destopargs\i0 );\keepn\hyphpar0\par\pard\sb200\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDLOAD}{\*\bkmkend ID_STANDARDLOAD}\b\f2 Standard_load Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_load\fs18 (\i dest\i0 \i prog\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 prog\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDREBOOT}{\*\bkmkend ID_STANDARDREBOOT}\b\f2 Standard_reboot Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_reboot\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDSEND}{\*\bkmkend ID_STANDARDSEND}\b\f2 Standard_send Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_send\fs18 (\i dest\i0 \i string\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDSPAWN}{\*\bkmkend ID_STANDARDSPAWN}\b\f2 Standard_spawn Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_spawn\fs18 (\i dest\i0 \i commandline\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 commndline\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDTRANSMIT}{\*\bkmkend ID_STANDARDTRANSMIT}\b\f2 Standard_transmit Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_transmit\fs18 (\i dest\i0 \i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDUPLOAD}{\*\bkmkend ID_STANDARDUPLOAD}\b\f2 Standard_upload Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_upload\fs18 (\i dest srcfile destfile\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 srcfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_STANDARDWAIT}{\*\bkmkend ID_STANDARDWAIT}\b\f2 Standard_wait Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 standard_wait\fs18 (\i dest\i0 \i timeout\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 timeout\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_UNIXCLEANFILENAME}{\*\bkmkend ID_UNIXCLEANFILENAME}\b\f2 Unix_clean_filename Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 unix_clean_filename\fs18 (\i dest\i0 \i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_CONNPROCS}{\*\bkmkend ID_CONNPROCS}\b\fs22\f2 Procedures For Using Utilities to Connect\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 telnet, rsh, tip, kermit\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TELNET}{\*\bkmkend ID_TELNET}\b\lang1024\f2 telnet Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 telnet\fs18 (\i hostname\i0 \i port\i0 );\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16 rlogin\fs18 (\i hostname\i0 );\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RSH}{\*\bkmkend ID_RSH}\b\fs20\f2 rsh Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 rsh\fs18 (\i hostname\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 hostname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This refers to the IP address or name (for example, an entry in \fs18\f3 /etc/hosts\fs20\f1 ) for this target. The procedure names reflect the Unix utility used to establish a connection. The optional \i\f3 port\i0\f1 is used to specify the IP port number. The value of the \i\f3 netport\i0\f1 field in the target_info array is used. (was $netport) This value has two parts, the hostname and the port number, seperated by a \i :\i0 . If host or target is used in the hostname field, than the config array is used for all information.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TIP}{\*\bkmkend ID_TIP}\b\f2 Tip Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 tip\fs18 (\i port\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 port\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab Connect using the Unix utility \b tip\b0 . \i\f3 Port\i0\f1 must be a name from the tip configuration file \fs18\f3 /etc/remote\fs20\f1 . Often, this is called hardwire, or something like ttya. This file holds all the configuration data for the serial port. The value of the serial field in the target_info array is used. (was $serialport) If \fs18\f3 host\fs20\f1 or \fs18\f3 target\fs20\f1 is used in the \i\f3 port\i0\f1 field, than the config array is used for all information. the config array is used for all information.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_KERMIT}{\*\bkmkend ID_KERMIT}\b\f2 Kermit Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 kermit\fs18 (\i port\i0 \i bps\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 port\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab Connect using the program \b kermit\b0 . \i\f3 Port\i0\f1 is the device name, e.g. \fs18\f3 /dev/ttyb\fs20\f1 . \hyphpar0\par\pard\sb200\sl220\qj \i\f3 bps\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \i\f3 bps\i0\f1 is the line speed to use (in its per second) for the connection. The value of the serial field in the target_info array is used. (was $serialport) If \fs18\f3 host\fs20\f1 or \fs18\f3 target\fs20\f1 is used in the \i\f3 port\i0\f1 field, than the config array is used for all information. the config array is used for all information.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_KERMITOPEN}{\*\bkmkend ID_KERMITOPEN}\b\f2 kermit_open Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 kermit_open\fs18 (\i dest\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_KERMITCOMMAND}{\*\bkmkend ID_KERMITCOMMAND}\b\f2 Kermit_command Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 kermit_command\fs18 (\i dest\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_KERMITSEND}{\*\bkmkend ID_KERMITSEND}\b\f2 Kermit_send Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 kermit_send\fs18 (\i dest string args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 string\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_KERMITTRANSMIT}{\*\bkmkend ID_KERMITTRANSMIT}\b\f2 Kermit_transmit Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 kermit_transmit\fs18 (\i dest\i0 \i file\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TELNETOPEN}{\*\bkmkend ID_TELNETOPEN}\b\f2 Telnet_open Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 telnet_open\fs18 (\i hostname\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 hostname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TELNETBINARY}{\*\bkmkend ID_TELNETBINARY}\b\f2 Telnet_binary Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 telnet_binary\fs18 (\i hostname\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 hostname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TELNETTRANSMIT}{\*\bkmkend ID_TELNETTRANSMIT}\b\f2 Telnet_transmit Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 telnet_transmit\fs18 (\i dest\i0 \i file\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TIPOPEN}{\*\bkmkend ID_TIPOPEN}\b\f2 Tip_open Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 tip_open\fs18 (\i hostname\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 hostname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RLOGINOPEN}{\*\bkmkend ID_RLOGINOPEN}\b\f2 Rlogin_open Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 rlogin_open\fs18 (\i arg\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 arg\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RLOGINSPAWN}{\*\bkmkend ID_RLOGINSPAWN}\b\f2 Rlogin_spawn Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 rlogin_spawn\fs18 (\i dest\i0 \i cmdline\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 dest\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 cmdline\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RSHOPEN}{\*\bkmkend ID_RSHOPEN}\b\f2 Rsh_open Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 rsh_open\fs18 (\i hostname\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 hostname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RSHDOWNLOAD}{\*\bkmkend ID_RSHDOWNLOAD}\b\f2 Rsh_download Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 rsh_download\fs18 (\i desthost\i0 \i srcfile\i0 \i destfile\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 desthost\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 srcfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RSHUPLOAD}{\*\bkmkend ID_RSHUPLOAD}\b\f2 Rsh_upload Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 rsh_upload\fs18 (\i desthost\i0 \i srcfile\i0 \i destfile\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 desthost\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 srcfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RSHEXEC}{\*\bkmkend ID_RSHEXEC}\b\f2 Rsh_exec Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 rsh_exec\fs18 (\i boardname\i0 \i cmd\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 boardname\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 cmd\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FTPOPEN}{\*\bkmkend ID_FTPOPEN}\b\f2 Ftp_open Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 ftp_open\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FTPUPLOAD}{\*\bkmkend ID_FTPUPLOAD}\b\f2 Ftp_upload Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 ftp_upload\fs18 (\i host\i0 \i remotefile\i0 \i localfile\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 remotefile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 localfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FTPDOWNLOAD}{\*\bkmkend ID_FTPDOWNLOAD}\b\f2 Ftp_download Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 ftp_download\fs18 (\i host\i0 \i localfile\i0 \i remotefile\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 localfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 remotefile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FTPCLOSE}{\*\bkmkend ID_FTPCLOSE}\b\f2 Ftp_close Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 ftp_close\fs18 (\i host\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 host\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TIPDOWNLOAD}{\*\bkmkend ID_TIPDOWNLOAD}\b\f2 Tip_download Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 tip_download\fs18 (\i spawnid\i0 \i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 spawnid\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab Download \fs18\f3 file\fs20\f1 to the process spawnid (the value returned when the connection was established), using the \b ~put\b0 command under tip. Most often used for single board computers that require downloading programs in ASCII S-records. Returns \i 1\i0 if an error occurs, \i 0\i0 otherwise.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab This is the filename to downlaod.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_TARGETPROCS}{\*\bkmkend ID_TARGETPROCS}\b\fs22\f2 Procedures For Target Boards\keepn\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_DEFAULTLINK}{\*\bkmkend ID_DEFAULTLINK}\fs20 Default_link Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 default_link\fs18 (\i board\i0 \i objects\i0 \i destfile\i0 \i flags\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 board\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 objects\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 flags\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_DEFAULTTARGETASSEMBLE}{\*\bkmkend ID_DEFAULTTARGETASSEMBLE}\b\f2 Default_target_assemble Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 default_target_assemble\fs18 (\i source\i0 \i destfile\i0 \i flags\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 source\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 flags\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_DEFAULTTARGETCOMPILE}{\*\bkmkend ID_DEFAULTTARGETCOMPILE}\b\f2 default_target_compile Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 default_target_compile\fs18 (\i source\i0 \i destfile\i0 \i type\i0 \i options\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 source\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 type\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 options\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_POPCONFIG}{\*\bkmkend ID_POPCONFIG}\b\f2 Pop_config Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 pop_config\fs18 (\i type\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 type\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PRUNEWARNINGS}{\*\bkmkend ID_PRUNEWARNINGS}\b\f2 Prune_warnings Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 prune_warnings\fs18 (\i text\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 text\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PUSHBUILD}{\*\bkmkend ID_PUSHBUILD}\b\f2 Push_build Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 push_build\fs18 (\i name\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 name\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PUSHCONFIG}{\*\bkmkend ID_PUSHCONFIG}\b\f2 push_config Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 push_config\fs18 (\i type\i0 \i name\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 type\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 name\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_REBOOTTARGET}{\*\bkmkend ID_REBOOTTARGET}\b\f2 Reboot_target Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 reboot_target\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TARGETASSEMBLE}{\*\bkmkend ID_TARGETASSEMBLE}\b\fs20\f2 Target_assemble Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 target_assemble\fs18 (\i source destfile flags\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 source\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 flags\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TARGETCOMPILE}{\*\bkmkend ID_TARGETCOMPILE}\b\f2 Target_compile Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 target_compile\fs18 (\i source\i0 \i destfile\i0 \i type\i0 \i options\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 source\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 destfile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 type\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 options\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_TARGETDB}{\*\bkmkend ID_TARGETDB}\b\fs22\f2 Target Database Procedures\keepn\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_BOARDINFO}{\*\bkmkend ID_BOARDINFO}\fs20 Board_info Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 board_info\fs18 (\i machine\i0 \i op\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 machine\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 op\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_HOSTINFO}{\*\bkmkend ID_HOSTINFO}\b\f2 Host_info Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 host_info\fs18 (\i op\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 op\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_SETBOARDINFO}{\*\bkmkend ID_SETBOARDINFO}\b\f2 Set_board_info Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 set_board_info\fs18 (\i entry\i0 \i value\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 entry\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 value\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_SETCURRTARGETINFO}{\*\bkmkend ID_SETCURRTARGETINFO}\b\f2 Set_currtarget_info Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 set_currtarget_info\fs18 (\i entry\i0 \i value\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 entry\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 value\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TARGETINFO}{\*\bkmkend ID_TARGETINFO}\b\f2 Target_info Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 target_info\fs18 (\i op\i0 \i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 op\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_UNSETBOARDINFO}{\*\bkmkend ID_UNSETBOARDINFO}\b\f2 Unset_board_info Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 unset_board_info\fs18 (\i entry\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 entry\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_UNSETCURRTARGETINFO}{\*\bkmkend ID_UNSETCURRTARGETINFO}\b\f2 Unset_currtarget_info Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 unset_currtarget_info\fs18 (\i entry\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 entry\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PUSHTARGET}{\*\bkmkend ID_PUSHTARGET}\b\f2 Push_target Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This makes the target named \i name\i0 be the current target connection. The value of \i name\i0 is an index into the target_info array and is set in the global config file.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 push_target\fs18 (\i name\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 name\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The name of the target to make current connection.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_POPTARGET}{\*\bkmkend ID_POPTARGET}\b\f2 Pop_target Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This unsets the current target connection.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 pop_target\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LISTTARGETS}{\*\bkmkend ID_LISTTARGETS}\b\fs20\f2 List_targets Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This lists all the supported targets for this architecture.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 list_targets\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PUSHHOST}{\*\bkmkend ID_PUSHHOST}\b\fs20\f2 Push_host Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This makes the host named \i name\i0 be the current remote host connection. The value of \i name\i0 is an index into the target_info array and is set in the global config file.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 push_host\fs18 (\i name\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 name\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_POPHOST}{\*\bkmkend ID_POPHOST}\b\f2 Pop_host Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This unsets the current host connection.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 pop_host\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_COMPILE}{\*\bkmkend ID_COMPILE}\b\fs20\f2 Compile Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This invokes the compiler as set by CC to compile the file \fs18\f3 file\fs20\f1 . The default options for many cross compilation targets are \i guessed\i0 by DejaGnu, and these options can be added to by passing in more parameters as arguments to \b compile\b0 . Optionally, this will also use the value of the \i cflags\i0 field in the target config array. If the host is not the same as the build machines, then then compiler is run on the remote host using \b execute_anywhere\b0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 compile\fs18 (\i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_ARCHIVE}{\*\bkmkend ID_ARCHIVE}\b\f2 Archive Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This produces an archive file. Any parameters passed to \b archive\b0 are used in addition to the default flags. Optionally, this will also use the value of the \i arflags\i0 field in the target config array. If the host is not the same as the build machines, then then archiver is run on the remote host using \b execute_anywhere\b0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 archive\fs18 (\i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RANLIB}{\*\bkmkend ID_RANLIB}\b\f2 Ranlib Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This generates an index for the archive file for systems that aren't POSIX yet. Any parameters passed to \b ranlib\b0 are used in for the flags.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 ranlib\fs18 (\i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 file\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_EXECUTEANYWHERE}{\*\bkmkend ID_EXECUTEANYWHERE}\b\f2 Execute_anywhere Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This executes the \i cmdline\i0 on the proper host. This should be used as a replacement for the Tcl command \b exec\b0 as this version utilizes the target config info to execute this command on the build machine or a remote host. All config information for the remote host must be setup to have this command work. If this is a canadian cross, (where we test a cross compiler that runs on a different host then where DejaGnu is running) then a connection is made to the remote host and the command is executed there. It returns either REMOTERROR (for an error) or the output produced when the command was executed. This is used for running the tool to be tested, not a test case.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 execute_anywhere\fs18 (\i cmdline\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 cmdline\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_PLATFORMPROCS}{\*\bkmkend ID_PLATFORMPROCS}\b\fs22\f2 Platform Dependant Procedures\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 Each combination of target and tool requires some target-dependent procedures. The names of these procedures have a common form: the tool name, followed by an underbar \i _\i0 , and finally a suffix describing the procedure's purpose. For example, a procedure to extract the version from GDB is called gdb_version.\hyphpar0\par\pard\sb100\li960\sl220\qj \b runtest\b0 itself calls only two of these procedures, $\{tool\}_exit and $\{tool\}_version; these procedures use no arguments.\hyphpar0\par\pard\sb100\li960\sl220\qj The other two procedures, $\{tool\}_start and $\{tool\}_load\}, are only called by the test suites themselves (or by testsuite-specific initialization code); they may take arguments or not, depending on the conventions used within each testsuite.\hyphpar0\par\pard\sb100\li960\sl220\qj The usual convention for return codes from any of these procedures (although it is not required by \b runtest\b0 ) is to return \i 0\i0 if the procedure succeeded, \i 1\i0 if it failed, and \i -1\i0 if there was a communication error.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TOOLSTART}{\*\bkmkend ID_TOOLSTART}\b\lang1024\f2 $\{tool\}_start Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Starts a particular tool. For an interactive tool, \fs18\f3 $\{tool\}_start\fs20\f1 starts and initializes the tool, leaving the tool up and running for the test cases; an example is \fs18\f3 gdb_start\fs20\f1 , the start function for GDB. For a batch oriented tool, \fs18\f3 $\{tool\}_start\fs20\f1 is optional; the recommended convention is to let \fs18\f3 $\{tool\}_start\fs20\f1 run the tool, leaving the output in a variable called \fs18\f3 comp_output\fs20\f1 . Test scripts can then analyze \fs18\f3 $comp_output\fs20\f1 to determine the test results. An example of this second kind of start function is \fs18\f3 gcc_start\fs20\f1 , the start function for GCC.\hyphpar0\par\pard\sb100\li960\sl220\qj DejaGnu itself does not call \fs18\f3 $\{tool\}_start\fs20\f1 . The initialization module \fs18\f3 $\{tool\}_init.exp\fs20\f1 must call \fs18\f3 $\{tool\}_start\fs20\f1 for interactive tools; for batch-oriented tools, each individual test script calls \fs18\f3 $\{tool\}_start\fs20\f1 (or makes other arrangements to run the tool).\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 $\{tool\}_start\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TOOLLOAD}{\*\bkmkend ID_TOOLLOAD}\b\fs20\f2 $\{tool\}_load Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Loads something into a tool. For an interactive tool, this conditions the tool for a particular test case; for example, \fs18\f3 gdb_load\fs20\f1 loads a new executable file into the debugger. For batch oriented tools, \fs18\f3 $\{tool\}_load\fs20\f1 may do nothing---though, for example, the GCC support uses \fs18\f3 gcc_load\fs20\f1 to load and run a binary on the target environment. Conventionally, \fs18\f3 $\{tool\}_load\fs20\f1 leaves the output of any program it runs in a variable called $exec_output. Writing \fs18\f3 $\{tool\}_load\fs20\f1 can be the most complex part of extending DejaGnu to a new tool or a new target, if it requires much communication coding or file downloading. Test scripts call \fs18\f3 $\{tool\}_load\fs20\f1 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 $\{tool\}_load\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TOOLEXIT}{\*\bkmkend ID_TOOLEXIT}\b\fs20\f2 $\{tool\}_exit Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Cleans up (if necessary) before DejaGnu exits. For interactive tools, this usually ends the interactive session. You can also use \fs18\f3 $\{tool\}_exit\fs20\f1 to remove any temporary files left over from the tests. \b runtest\b0 calls \fs18\f3 $\{tool\}_exit\fs20\f1 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 $\{tool\}_exit\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_TOOLVERSION}{\*\bkmkend ID_TOOLVERSION}\b\fs20\f2 $\{tool\}_version Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Prints the version label and number for $\{tool\}. This is called by the DejaGnu procedure that prints the final summary report. The output should consist of the full path name used for the tested tool, and its version number.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 $\{tool\}_version\fs18 ();\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_UTILPROCS}{\*\bkmkend ID_UTILPROCS}\b\fs22\f2 Utility Procedures\keepn\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_GETDIRS}{\*\bkmkend ID_GETDIRS}\fs20 Getdirs Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Returns a list of all the directories in the single directory a single directory that match an optional pattern. \hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 getdirs\fs18 (\i rootdir\i0 \i pattern\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\sl220\qj \i\f3 pattern\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab If you do not specify \i\f3 pattern\i0\f1 , \fs18\f3 Getdirs\fs20\f1 assumes a default pattern of \i *\i0 . You may use the common shell wildcard characters in the pattern. If no directories match the pattern, then a NULL string is returned\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FIND}{\*\bkmkend ID_FIND}\b\f2 Find Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Search for files whose names match \i pattern\i0 (using shell wildcard characters for filename expansion). Search subdirectories recursively, starting at \i rootdir\i0 . The result is the list of files whose names match; if no files match, the result is empty. Filenames in the result include all intervening subdirectory names. If no files match the pattern, then a NULL string is returned.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 find\fs18 (\i rootdir\i0 \i pattern\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 rootdir\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The top level directory to search the search from.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 pattern\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab A csh "glob" style regular expression reprsenting the files to find.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WHICH}{\*\bkmkend ID_WHICH}\b\f2 Which Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Searches the execution path for an executable file \i binary\i0 , like the the BSD \b which\b0 utility. This procedure uses the shell environment variable \i PATH\i0 . It returns \i 0\i0 if the binary is not in the path, or if there is no \i PATH\i0 environment variable. If \b binary\b0 is in the path, it returns the full path to \b binary\b0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 which\fs18 (\i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 binary\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The executable program or shell script to look for.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_GREP}{\*\bkmkend ID_GREP}\b\f2 Grep Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Search the file called \fs18\f3 filename\fs20\f1 (a fully specified path) for lines that contain a match for regular expression \i regexp\i0 . The result is a list of all the lines that match. If no lines match, the result is an empty string. Specify \i regexp\i0 using the standard regular expression style used by the Unix utility program grep.\hyphpar0\par\pard\sb100\li960\sl220\qj Use the optional third argument \i line\i0 to start lines in the result with the line number in \fs18\f3 filename\fs20\f1 . (This argument is simply an option flag; type it just as shown \fs18\f3 --line\fs20\f1 .)\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 grep\fs18 (\i filename\i0 \i regexp\i0 \i --line\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 filename\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The file to search.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 regexp\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The Unix style regular expression (as used by the \b grep\b0 Unix utility) to search for.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 --line\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab Prefix the line number to each line where the regexp matches.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PRUNE}{\*\bkmkend ID_PRUNE}\b\f2 Prune Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Remove elements of the Tcl list \i list\i0 . Elements are fields delimited by spaces. The result is a copy of list, without any elements that match \i pattern\i0 . You can use the common shell wildcard characters to specify the pattern.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 prune\fs18 (\i list\i0 \i pattern\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 list\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab A Tcl list containing the original data. Commonly this is the output of a batch executed command, like running a compiler.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 pattern\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The csh shell "glob" style pattern to search for.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_SLAY}{\*\bkmkend ID_SLAY}\b\f2 Slay Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This look in the process table for \i name\i0 and send it a unix SIGINT, killing the process. This will only work under Windows if you have Cygwin or another Unix subsystem for Windows installed.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 slay\fs18 (\i name\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 name\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The name of the program to kill.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_ABSOLUTE}{\*\bkmkend ID_ABSOLUTE}\b\f2 Absolute Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This procedure takes the relative \i path\i0 , and converts it to an absolute path.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 absolute\fs18 (\i path\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 path\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The path to convert.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PSOURCE}{\*\bkmkend ID_PSOURCE}\b\f2 Psource Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This sources the file \i filename\i0 , and traps all errors. It also ignores all extraneous output. If there was an error it returns a \i 1\i0 , otherwise it returns a \i 0\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 psource\fs18 (\i file\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 filename\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The filename to Tcl script to source.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_RUNTESTFILEP}{\*\bkmkend ID_RUNTESTFILEP}\b\f2 Runtest_file_p Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Search \i runtest\i0 s for \i testcase\i0 and return \i 1\i0 if found, \i 0\i0 if not. \i runtests\i0 is a list of two elements. The first is a copy of what was on the right side of the \i =\i0 if \hyphpar0\par\pard\sb200\li960\sl198\qj \fs18\f3 foo.exp="..."\hyphpar0\par\pard\sb200\li960\sl220\qj \fs20\f1 " was specified, or an empty string if no such argument is present. The second is the pathname of the current testcase under consideration. This is used by tools like compilers where each testcase is a file.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 runtest_file_p\fs18 (\i runtests\i0 \i testcase\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 runtests\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The list of patterns to compare against. \hyphpar0\par\pard\sb200\sl220\qj \i\f3 testcase\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The test case filename.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_DIFF}{\*\bkmkend ID_DIFF}\b\f2 Diff Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Compares the two files and returns a \i 1\i0 if they match, or a \i 0\i0 if they don't. If verbose is set, then it'll print the differences to the screen.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 diff\fs18 (\i file_1\i0 \i file_2\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 file_1\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The first file to compare.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 file_2\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The second file to compare.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_SETENV}{\*\bkmkend ID_SETENV}\b\f2 Setenv Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Sets the environment variable \i var\i0 to the value \i val\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 setenv\fs18 (\i var\i0 \i val\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 var\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The environment variable to set.\hyphpar0\par\pard\sb200\sl220\qj \i\f3 val\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The value to set the variable to.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_UNSETENV}{\*\bkmkend ID_UNSETENV}\b\f2 unsetenv Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Unsets the environment variable \i var\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 unsetenv\fs18 (\i var\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 var\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The environment variable to unset.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_GETENV}{\*\bkmkend ID_GETENV}\b\f2 Getenv Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 Returns the value of \i var\i0 in the environment if it exists, otherwise it returns NULL.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 getenv\fs18 (\i var\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 var\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The environment variable to get the value of.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PRUNESYSTEMCRUD}{\*\bkmkend ID_PRUNESYSTEMCRUD}\b\f2 Prune_system_crud Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 For system \i system\i0 , delete text the host or target operating system might issue that will interfere with pattern matching of program output in \i text\i0 . An example is the message that is printed if a shared library is out of date.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 prune_system_crud\fs18 (\i system\i0 \i test\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 system\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The system error messages to look for to screen out .\hyphpar0\par\pard\sb200\sl220\qj \i\f3 text\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The Tcl variable containing the text.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_LIBGLOSS}{\*\bkmkend ID_LIBGLOSS}\b\fs22\f2 Libgloss, A Free BSP\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 Libgloss is a free \i BSP\i0 (Board Support Package) commonly used with GCC and G++ to produce a fully linked executable image for an embedded systems.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LIBGLOSSLINKFLAGS}{\*\bkmkend ID_LIBGLOSSLINKFLAGS}\b\lang1024\f2 Libgloss_link_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 libgloss_link_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LIBGLOSSINCLUDEFLAGS}{\*\bkmkend ID_LIBGLOSSINCLUDEFLAGS}\b\f2 Libgloss_include_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 libgloss_include_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_NEWLIBLINKFLAGS}{\*\bkmkend ID_NEWLIBLINKFLAGS}\b\f2 Newlib_link_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 newlib_link_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_NEWLIBINCLUDEFLAGS}{\*\bkmkend ID_NEWLIBINCLUDEFLAGS}\b\f2 Newlib_include_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 newlib_include_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LIBIOINCLUDEFLAGS}{\*\bkmkend ID_LIBIOINCLUDEFLAGS}\b\f2 Libio_include_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 libio_include_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LIBIOLINKFLAGS}{\*\bkmkend ID_LIBIOLINKFLAGS}\b\f2 Libio_link_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 libio_link_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_GXXINCLUDEFLAGS}{\*\bkmkend ID_GXXINCLUDEFLAGS}\b\f2 G++_include_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 g++_include_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_GXXLINKFLAGS}{\*\bkmkend ID_GXXLINKFLAGS}\b\f2 G++_link_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 g++_link_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LIBSTDCXXINCLUDEFLAGS}{\*\bkmkend ID_LIBSTDCXXINCLUDEFLAGS}\b\f2 Libstdc++_include_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 libstdc++_include_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_LIBSTDCXXLINKFLAGS}{\*\bkmkend ID_LIBSTDCXXLINKFLAGS}\b\f2 Libstdc++_link_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 libstdc++_link_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_GETMULTILIBS}{\*\bkmkend ID_GETMULTILIBS}\b\f2 Get_multilibs Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 get_multilibs\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FINDBINUTILSPROG}{\*\bkmkend ID_FINDBINUTILSPROG}\b\f2 Find_binutils_prog Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 find_binutils_prog\fs18 (\i name\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 name\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FINDGCC}{\*\bkmkend ID_FINDGCC}\b\f2 Find_gcc Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 find_gcc\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FINDGCJ}{\*\bkmkend ID_FINDGCJ}\b\fs20\f2 Find_gcj Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 find_gcj\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FINDGXX}{\*\bkmkend ID_FINDGXX}\b\fs20\f2 Find_g++ Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 find_g++\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FINDG77}{\*\bkmkend ID_FINDG77}\b\fs20\f2 Find_g77 Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 find_g77\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PROCESSMULTILIBOPTIONS}{\*\bkmkend ID_PROCESSMULTILIBOPTIONS}\b\fs20\f2 Process_multilib_options Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 process_multilib_options\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_ADDMULTILIBOPTION}{\*\bkmkend ID_ADDMULTILIBOPTION}\b\f2 Add_multilib_option Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 add_multilib_option\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FINDGAS}{\*\bkmkend ID_FINDGAS}\b\f2 Find_gas Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 find_gas\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_FINDLD}{\*\bkmkend ID_FINDLD}\b\fs20\f2 Find_ld Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 find_ld\fs18 ();\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_BUILDWRAPPER}{\*\bkmkend ID_BUILDWRAPPER}\b\fs20\f2 Build_wrapper Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 build_wrapper\fs18 (\i gluefile\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 gluefile\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WINSUPINCLUDEFLAGS}{\*\bkmkend ID_WINSUPINCLUDEFLAGS}\b\f2 Winsup_include_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 winsup_include_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WINSUPLINKFLAGS}{\*\bkmkend ID_WINSUPLINKFLAGS}\b\f2 Winsup_link_flags Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 winsup_link_flags\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_DEBUGPROCS}{\*\bkmkend ID_DEBUGPROCS}\b\fs22\f2 Procedures for debugging your Tcl code.\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs18\lang1033\f3 lib/debugger.exp\fs20\f1 defines these utility procedures:\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_DUMPVARS}{\*\bkmkend ID_DUMPVARS}\b\lang1024\f2 Dumpvars Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This takes a csh style regular expression (glob rules) and prints the values of the global variable names that match. It is abbreviated as \i dv\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 dumpvars\fs18 (\i vars\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 vars\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The variables to dump.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_DUMPLOCALS}{\*\bkmkend ID_DUMPLOCALS}\b\f2 Dumplocals Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This takes a csh style regular expression (glob rules) and prints the values of the local variable names that match. It is abbreviated as \i dl\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 dumplocals\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_DUMPROCS}{\*\bkmkend ID_DUMPROCS}\b\f2 Dumprocs Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This takes a csh style regular expression (glob rules) and prints the body of all procs that match. It is abbreviated as \i dp\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 dumprocs\fs18 (\i pattern\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 pattern\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The csh "glob" style pattern to look for.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_DUMPWATCH}{\*\bkmkend ID_DUMPWATCH}\b\f2 Dumpwatch Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This takes a csh style regular expression (glob rules) and prints all the watchpoints. It is abbreviated as \i dw\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 dumpwatch\fs18 (\i pattern\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 pattern\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The csh "glob" style pattern to look for.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WATCHARRAY}{\*\bkmkend ID_WATCHARRAY}\b\f2 Watcharray Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 watcharray\fs18 (\i element\i0 \i type\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 type\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The csh "glob" style pattern to look for.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WATCHVAR}{\*\bkmkend ID_WATCHVAR}\b\f2 Watchvar Procedure\keepn\hyphpar0\par\pard\sb200\li960\sl198\qj \b0\fs16\f3 watchvar\fs18 (\i var\i0 \i type\i0 );\keepn\hyphpar0\par\pard\sb200\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WATCHUNSET}{\*\bkmkend ID_WATCHUNSET}\b\f2 Watchunset Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This breaks program execution when the variable var is unset. It is abbreviated as \i wu\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 watchunset\fs18 (\i arg\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WATCHWRITE}{\*\bkmkend ID_WATCHWRITE}\b\f2 Watchwrite Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This breaks program execution when the variable var is written. It is abbreviated as \i ww\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 watchwrite\fs18 (\i var\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 var\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The variable to watch.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WATCHREAD}{\*\bkmkend ID_WATCHREAD}\b\f2 Watchread Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This breaks program execution when the variable var is read. It is abbreviated as \i wr\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 watchread\fs18 (\i var\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 var\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab The variable to watch.\hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_WATCHDEL}{\*\bkmkend ID_WATCHDEL}\b\f2 Watchdel Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This deletes a the watchpoint from the watch list. It is abbreviated as \i wd\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 watchdel\fs18 (\i args\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 args\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_PRINT}{\*\bkmkend ID_PRINT}\b\f2 Print Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This prints the value of the variable \i\f3 var\i0\f1 . It is abbreviated as \i p\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 print\fs18 (\i var\i0 );\hyphpar0\par\pard\sb200\sl220\qj \i\fs20 var\keepn\hyphpar0\par\pard\sb100\li1360\sl220\fi-400\qj \tx1360 \i0\f1 \~\tab \hyphpar0\par\pard\sb200\s4\li960\sl220 {\*\bkmkstart ID_QUIT}{\*\bkmkend ID_QUIT}\b\f2 Quit Procedure\keepn\hyphpar0\par\pard\sb100\li960\sl220\qj \b0\lang1033\f1 This makes runtest exit. It is abbreviated as \i q\i0 .\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 quit\fs18 ();\keepn\hyphpar0\par\pard\sb200\li1360\sl220\fi-400\qj \tx1360 \fs20\f1 \~\tab \hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_FILEMAP}{\*\bkmkend ID_FILEMAP}\b\fs24\f2 File Map\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 This is a map of the files in DejaGnu.\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16\lang1024 \'95\tab \fs20 runtest\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 runtest.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 stub-loader.c\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 testglue.c\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 config\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 baseboards\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/debugger.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/dg.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/framework.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/ftp.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/kermit.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/libgloss.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/mondfe.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/remote.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/rlogin.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/rsh.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/standard.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/target.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/targetdb.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/telnet.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/tip.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/util-defs.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/utils.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/xsh.exp\hyphpar0\par\pard\sb100\li1160\sl220\fi-200\qj \tx1160 \fs16 \'95\tab \fs20 lib/dejagnu.exp\hyphpar0\par\pard\sb200\sl293 \b\fs26\f2 Notes\keepn\hyphpar0\par\pard\sb133\li1280\sl220\fi-320\qj \tx1280 \b0\fs20\f1 1. \tab http://www.gnu.org\hyphpar0\par\pard\sb100\li1280\sl220\fi-320\qj \tx1280 2. \tab http://www.gnu.org/software/dejagnu/\hyphpar0\par\sect\sectd\plain\pgwsxn12240\pghsxn15840\marglsxn1920\margrsxn1920\margtsxn1440\margbsxn1200\headery0\footery0\pgndec\titlepg{\headerf\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {}\par}{\footerf\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}{\headerl\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 Chapter 8. Unit Testing API}\tab {}\tab {}\par}{\footerl\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {\i\fs20\f1 \chpgn }\tab {}\tab {}\par}{\headerr\pard\sl-240\sb770\sa430\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 Chapter 8. Unit Testing API}\par}{\footerr\pard\sl-240\sb50\sa910\plain\tqc\tx4200\tqr\tx8400 {}\tab {}\tab {\i\fs20\f1 \chpgn }\par}\pard\sb220\s1\sl322 {\*\bkmkstart ID_UNITTESTAPI}{\*\bkmkend ID_UNITTESTAPI}\b\fs29\f2 Chapter 8. Unit Testing API\keepn\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_CUNIT}{\*\bkmkend ID_CUNIT}\fs24 C Unit Testing API\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 All of the functions that take a \i\f3 msg\i0\f1 parameter use a C char * that is the message to be dislayed. There currently is no support for variable length arguments.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_PASSFUNC}{\*\bkmkend ID_PASSFUNC}\b\fs22\lang1024\f2 Pass Function\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints a message for a successful test completion.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 pass\fs18 (\i msg\i0 );\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_FAILFUNC}{\*\bkmkend ID_FAILFUNC}\b\fs22\f2 Fail Function\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints a message for an unsuccessful test completion.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 fail\fs18 (\i msg\i0 );\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_UNTESTEDFUNC}{\*\bkmkend ID_UNTESTEDFUNC}\b\fs22\f2 Untested Function\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints a message for an test case that isn't run for some technical reason.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 untested\fs18 (\i msg\i0 );\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_UNRESOLVEDFUNC}{\*\bkmkend ID_UNRESOLVEDFUNC}\b\fs22\f2 Unresolved Function\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints a message for an test case that is run, but there is no clear result. These output states require a human to look over the results to determine what happened. \hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 unresolved\fs18 (\i msg\i0 );\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_TOTALSFUNC}{\*\bkmkend ID_TOTALSFUNC}\b\fs22\f2 Totals Function\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints out the total numbers of all the test state outputs.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 totals\fs18 ();\hyphpar0\par\pard\sb200\s2\sl266 {\*\bkmkstart ID_CPPUNIT}{\*\bkmkend ID_CPPUNIT}\b\fs24\f2 C++ Unit Testing API\keepn\hyphpar0\par\pard\sb121\li960\sl220\qj \b0\fs20\lang1033\f1 All of the methods that take a \i\f3 msg\i0\f1 parameter use a C char * or STL string, that is the message to be dislayed. There currently is no support for variable length arguments.\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_PASSMETH}{\*\bkmkend ID_PASSMETH}\b\fs22\lang1024\f2 Pass Method\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints a message for a successful test completion.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 TestState::pass\fs18 (\i msg\i0 );\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_FAILMETH}{\*\bkmkend ID_FAILMETH}\b\fs22\f2 Fail Method\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints a message for an unsuccessful test completion.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 TestState::fail\fs18 (\i msg\i0 );\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_UNTESTEDMETH}{\*\bkmkend ID_UNTESTEDMETH}\b\fs22\f2 Untested Method\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints a message for an test case that isn't run for some technical reason.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 TestState::untested\fs18 (\i msg\i0 );\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_UNRESOLVEDMETH}{\*\bkmkend ID_UNRESOLVEDMETH}\b\fs22\f2 Unresolved Method\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints a message for an test case that is run, but there is no clear result. These output states require a human to look over the results to determine what happened. \hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 TestState::unresolved\fs18 (\i msg\i0 );\hyphpar0\par\pard\sb200\s3\li960\sl242 {\*\bkmkstart ID_TOTALSMETH}{\*\bkmkend ID_TOTALSMETH}\b\fs22\f2 Totals Method\keepn\hyphpar0\par\pard\sb110\li960\sl220\qj \b0\fs20\lang1033\f1 This prints out the total numbers of all the test state outputs.\hyphpar0\par\pard\sb200\li960\sl198\qj \fs16\lang1024\f3 TestState::totals\fs18 ();\hyphpar0\par}