| 1 |
|
| 2 |
<HTML> |
| 3 |
<HEAD> |
| 4 |
<TITLE>Where to Find Example/Test Code</TITLE> |
| 5 |
</HEAD> |
| 6 |
<BODY> |
| 7 |
|
| 8 |
|
| 9 |
<H2><A NAME="xpacode">XPACode: Where to Find Example/Test Code</A></H2> |
| 10 |
|
| 11 |
|
| 12 |
<H2>Summary</H2> |
| 13 |
<P> |
| 14 |
The XPA source code directory contains two test programs, |
| 15 |
<EM>stest.c</EM>, and <EM>ctest.c</EM> that can serve as |
| 16 |
examples for writing XPA servers and clients, respectively. |
| 17 |
They also can be used to test various features of XPA. |
| 18 |
|
| 19 |
|
| 20 |
<H2>Description</H2> |
| 21 |
<P> |
| 22 |
To build the XPA test programs, execute: |
| 23 |
<PRE> |
| 24 |
make All |
| 25 |
</PRE> |
| 26 |
in the XPA source directory to generate the <EM>stest</EM> and |
| 27 |
<EM>ctest</EM> programs. (NB: this should work on all platforms, |
| 28 |
although we have had problems with unresolved externals on one |
| 29 |
Sun/Solaris machine, for reasons still unknown.) |
| 30 |
<P> |
| 31 |
The stest program can be executed with no arguments to start |
| 32 |
an XPA server that contains the access points: xpa, xpa1, |
| 33 |
c_xpa (containing sub-commands cmd1 and cmd2), and i_xpa. |
| 34 |
You then can use xpaset and xpaget to interact with these access points: |
| 35 |
<PRE> |
| 36 |
cat xpa.c | xpaset xpa # send to xpa |
| 37 |
cat xpa.c | xpaset "xpa*" # send to xpa and xpa1 |
| 38 |
xpaget xpa # receive from xpa |
| 39 |
xpaget xpa* # receive from xpa and xpa1 |
| 40 |
</PRE> |
| 41 |
etc. You also can use ctest to do the same thing, or to iterate: |
| 42 |
<PRE> |
| 43 |
ctest -s -l 100 xpa # send to xpa 100 times |
| 44 |
ctest -s -l 100 "xpa*" # send to xpa and xpa1 100 times |
| 45 |
ctest -g -l 100 xpa # receive from xpa 100 times |
| 46 |
ctest -g -l 100 "xpa*" # receive from xpa and xpa1 100 times |
| 47 |
</PRE> |
| 48 |
More options are available: see the stest.c and ctest.c code itself, which |
| 49 |
were used extensively to debug XPA. |
| 50 |
|
| 51 |
<P> |
| 52 |
The file test.tcl in the XPA source directory gives examples for using the |
| 53 |
<A HREF="./tcl.html">XPATcl</A>Interface. |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
<P> |
| 60 |
<A HREF="./help.html">Go to XPA Help Index</A> |
| 61 |
|
| 62 |
<H5>Last updated: September 10, 2003</H5> |
| 63 |
</BODY> |
| 64 |
</HTML> |