Repair Doxygen build infrastructure
[vpp.git] / src / vpp-api / lua / examples / lute / README.md
1 LUTE: Lua Unit Test Environment
2
3 This is a small helper utility to automate some simple tests
4 that one might need to do.
5
6 Think of it as a hybrid of a screen and expect who
7 also took some habits from HTML inline code.
8
9 It is quite probably useless for building anything serious,
10 but practice shows it is quite efficient at allowing
11 convenient temporary quick tests, and for something
12 that was written over a course of a couple of evenings it
13 is quite a nice little helper tool.
14
15 It allows do launch and drive multiple shell sessions,
16 and by virtue of having been written in Lua, it of course
17 also allows to add the business logic using the Lua code.
18
19 If you launch the lute without parameters, it gives you
20 the interactive shell to execute the commands in.
21
22 If you launch it with an argument, it will attempt to
23 read and execute the commands from the file.
24
25 Commands:
26
27 shell FOO
28
29   spawn a shell in a new PTY under the label FOO.
30
31 run FOO bar
32
33   Send "bar" keystrokes followed by "ENTER" to the session FOO
34
35   Special case: "break" word on its own gets translated into ^C being sent.
36
37 cd FOO
38
39   "change domain" into session FOO. All subsequent inputs will go,
40   line-buffered, into the session FOO. To jump back up, use ^D (Control-D),
41   or within the file, use ^D^D^D (caret D caret D caret D on its own line)
42
43 expect FOO blablabla
44
45   Pause further interpretation of the batch mode until you see "blablabla"
46   in the output of session FOO, or until timeout happens.
47
48 sleep N
49
50   Sleep an integer N seconds, if you are in batch mode.
51
52 echo blabla
53
54   Echo the remainder of the line to standard output.
55
56 For Lua code, there is a pre-existing pseudo-session called "lua",
57 which accepts "run lua" command which does what you would expect
58 (evaluate the rest of the string in Lua context - being the same
59 as lute itself). Also you can do "cd lua" and get into a
60 multiline-enabled interpreter shell.
61
62 This way for the VPP case you can automate some of the things in your routine
63 that you would have to have done manually, and test drive API as well
64 as use the realistic native OS components to create the environment around it.
65
66