Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Let xbt_exit() issue a warning stating that this is now a no-op
[simgrid.git] / tools / tesh / README.tesh
index 0b391c2..95a2374 100644 (file)
@@ -14,12 +14,16 @@ blank and is ignored):
  `<' input to pass to the command
  `>' output expected from the command
  `!' metacommand, which can be one of:
  `<' input to pass to the command
  `>' output expected from the command
  `!' metacommand, which can be one of:
-     `set timeout' <integer>
+     `timeout' <integer>|no
      `expect signal' <signal name>
      `expect return' <integer>
      `expect signal' <signal name>
      `expect return' <integer>
+     `output' <ignore|display>
+     `setenv <key>=<val>'
+ `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
 
 If the expected output do not match what the command spits, TESH will produce
-an error showing the diff.
+an error showing the diff (see OUTPUT below).
 
 IO orders
 ---------
 
 IO orders
 ---------
@@ -44,16 +48,32 @@ errors such as the following:
 
  $ cd toto
  > TOTO
 
  $ cd toto
  > TOTO
- $ cat > file
+ $ mkfile file
 
 TOTO will be passed to the cd command, where the user clearly want to pass it
 
 TOTO will be passed to the cd command, where the user clearly want to pass it
-to cat.
+to the mkfile buildin command (see below).
+
+Stream redirection
+------------------
+Stream redirections (">", "<" and "|" constructs in sh) are not
+implemented yet in tesh. This is a bit restrictive, but well, patch
+welcome...
+
+The situation in which it is mainly problematic is to create a
+temporary file. The solution is to use the "mkfile" buildin command,
+as in the following example:
+$ mkfile myFile
+> some content
+> to the file
+
+This will create a file called myFile (first argument of the mkfile
+command). Its content will be all the input provided to the command.
 
 RETURN CODE
 -----------
 
 TESH spits an appropriate error message when the child do not return 0 as
 
 RETURN CODE
 -----------
 
 TESH spits an appropriate error message when the child do not return 0 as
-return code (cf. catch-return.tesh).
+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
 
 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
@@ -73,7 +93,21 @@ TIMEOUTS
 --------
 
 By default, all commands are given 5 seconds to execute
 --------
 
 By default, all commands are given 5 seconds to execute
-(cf. catch-timeout.tesh). You can change this with the "set timeout", which
+(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
 takes an integer as argument. The change only apply to the next command
-(cf. set-timeout.tesh).
+(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)
+ENVIRONMENT
+-----------
+You can add some content to the tested processes environment with the
+setenv metacommand. It works as expected. For example:
+  "setenv PATH=/bin"
\ No newline at end of file