Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a win32 auto.tesh (because echo test and pwd do not exist on Windows)
[simgrid.git] / tools / tesh2 / examples / README.tesh
index f76a09b..90be389 100644 (file)
@@ -1,90 +1,90 @@
-This is the TESH tool. It constitutes a testing shell, ie a sort of shell\r
-specialized to run tests. The list of actions to take is parsed from files\r
-files called testsuite. \r
-\r
-Testsuites syntax\r
------------------\r
-Here is the syntax of these files:\r
-\r
-The kind of each line is given by the first char (the second char should be\r
-blank and is ignored):\r
\r
- `$' command to run in forground\r
- `&' command to run in background\r
- `<' input to pass to the command\r
- `>' output expected from the command\r
- `!' metacommand, which can be one of:\r
-     `timeout' <integer>|no\r
-     `expect signal' <signal name>\r
-     `expect return' <integer>\r
-     `output' <ignore|display>\r
- `p' a string to print\r
- `P' a string to print at the CRITICAL level (ease logging grepping)\r
-\r
-If the expected output do not match what the command spits, TESH will produce\r
-an error showing the diff (see OUTPUT below).\r
-\r
-IO orders\r
----------\r
-\r
-The < and > lines add IO to the command defined in the current block (blocks\r
-are separated by blank lines). It is possible to place these lines either after\r
-the command or before. The difference between the two following chunks is\r
-mainly cosmetic in your testsuites, TESH don't care. (cf IO-orders.tesh)\r
-\r
- $ cat\r
- < TOTO\r
- > TOTO\r
-\r
- > TOTO\r
- $ cat\r
- < TOTO\r
-\r
-Nevertheless, it is possible to have several commands in the same block, but\r
-none of them can have any output. It may seem a bit restrictive, as one could\r
-say that a command gets all the IO until the next command, but I'm afraid of\r
-errors such as the following:\r
-\r
- $ cd toto\r
- > TOTO\r
- $ cat > file\r
-\r
-TOTO will be passed to the cd command, where the user clearly want to pass it\r
-to cat.\r
-\r
-RETURN CODE\r
------------\r
-\r
-TESH spits an appropriate error message when the child do not return 0 as\r
-return code (cf. catch-return.tesh), and returns code+40 itself.\r
-\r
-It is also possible to specify that a given command must return another\r
-value. For this, use the "expect return" metacommand, which takes an integer as\r
-argument. The change only apply to the next command (cf. set-return.tesh).\r
-\r
-SIGNALS\r
--------\r
-\r
-TESH detects when the child is killed by a signal (like on segfaults), and\r
-spits an appropriate error message (cf. catch-signal.tesh).\r
-\r
-It is also possible to specify that a given command must raise a given\r
-signal. For this, use the "expect signal" metacommand. It takes the signal name\r
-as argument. The change only apply to the next command (cf. set-signal.tesh).\r
\r
-TIMEOUTS\r
---------\r
-\r
-By default, all commands are given 5 seconds to execute\r
-(cf. catch-timeout.tesh). You can change this with the "timeout", which\r
-takes an integer as argument. The change only apply to the next command\r
-(cf. set-timeout.tesh). If you pass "no" as argument, the command\r
-cannot timeout.\r
-\r
-OUTPUT\r
-------\r
-\r
-By default, the commands output is matched against the one expected,\r
-and an error is raised on discrepency. Metacomands to change this:\r
- "output ignore"  -> output completely discarded \r
+This is the TESH tool. It constitutes a testing shell, ie a sort of shell
+specialized to run tests. The list of actions to take is parsed from files
+files called testsuite. 
+
+Testsuites syntax
+-----------------
+Here is the syntax of these files:
+
+The kind of each line is given by the first char (the second char should be
+blank and is ignored):
+ `$' command to run in forground
+ `&' command to run in background
+ `<' input to pass to the command
+ `>' output expected from the command
+ `!' metacommand, which can be one of:
+     `timeout' <integer>|no
+     `expect signal' <signal name>
+     `expect return' <integer>
+     `output' <ignore|display>
+ `p' a string to print
+ `P' a string to print at the CRITICAL level (ease logging grepping)
+
+If the expected output do not match what the command spits, TESH will produce
+an error showing the diff (see OUTPUT below).
+
+IO orders
+---------
+
+The < and > lines add IO to the command defined in the current block (blocks
+are separated by blank lines). It is possible to place these lines either after
+the command or before. The difference between the two following chunks is
+mainly cosmetic in your testsuites, TESH don't care. (cf IO-orders.tesh)
+
+ $ Cat
+ < TOTO
+ > TOTO
+
+ > TOTO
+ $ Cat
+ < TOTO
+
+Nevertheless, it is possible to have several commands in the same block, but
+none of them can have any output. It may seem a bit restrictive, as one could
+say that a command gets all the IO until the next command, but I'm afraid of
+errors such as the following:
+
+ $ cd toto
+ > TOTO
+ $ Cat > file
+
+TOTO will be passed to the cd command, where the user clearly want to pass it
+to Cat.
+
+RETURN CODE
+-----------
+
+TESH spits an appropriate error message when the child do not return 0 as
+return code (cf. catch-return.tesh), and returns code+40 itself.
+
+It is also possible to specify that a given command must return another
+value. For this, use the "expect return" metacommand, which takes an integer as
+argument. The change only apply to the next command (cf. set-return.tesh).
+
+SIGNALS
+-------
+
+TESH detects when the child is killed by a signal (like on segfaults), and
+spits an appropriate error message (cf. catch-signal.tesh).
+
+It is also possible to specify that a given command must raise a given
+signal. For this, use the "expect signal" metacommand. It takes the signal name
+as argument. The change only apply to the next command (cf. set-signal.tesh).
+TIMEOUTS
+--------
+
+By default, all commands are given 5 seconds to execute
+(cf. catch-timeout.tesh). You can change this with the "timeout", which
+takes an integer as argument. The change only apply to the next command
+(cf. set-timeout.tesh). If you pass "no" as argument, the command
+cannot timeout.
+
+OUTPUT
+------
+
+By default, the commands output is matched against the one expected,
+and an error is raised on discrepency. Metacomands to change this:
+ "output ignore"  -> output completely discarded 
  "output display" -> output displayed (but not verified) 
\ No newline at end of file