A basic TRUT file looks something like this (see e.g. Timba/doc/Courses/Workshop2007/ME1/TRUT):

TRUT files consist of:

Directives

A directives specifies a test to be run. Currently (31/05/07), the only recognized directive is "TDL". This tells trut to compile the given TDL script.

Note that trut changes to the directory of the TRUT file before running any tests, so all filenames are relative to the current directory.

Options

Options can modify the behaviour of tests. Options may be nested:

Here, we specify a different, nested, option for the TDL demo2.py directive. To specify a nested option for a directive, indent the option and place it after the directive. Indentation follows the Python rules (i.e. any indent is OK as long as it remains consistent).

tdlconf option

This applies to TDL directives. tdlconf specifies a config file to be loaded prior to compiling the script. Config files are where all the compile-time and run-time TDL options are stored. The default is .tdl.conf, which is the same location as used by meqbrowser. Since this .tdl.conf is subject to change every time you change an option in the browser, you will usually want to make a separate "testing-only" config file containing TDL options to be used during testing. Copy .tdl.conf to something else (e.g. trut.tdl.conf), modify options, and check it into subversion.

Note that when compiling a script, trut will use the exact name of the script as given in the TRUT file (i.e. usually without a path) to look up the relevant tdl.conf section. The browser uses the full pathname of the script (which is behaviour I may change in the future...) When you make a copy of tdl.conf, check your section names and remove absolute pathnames. For example:

  1. Your .tdl.conf may look like this:

    • [/home/user/some/directory/example9-clar-shortcut.py] 
      imaging_mode = channel
      model_func = star8_model
      grid_step = 2
      grid_size = 3
      
  2. Copy it to trut.tdl.conf, and fix the section name:

    • [example9-clar-shortcut.py] 
      imaging_mode = channel
      model_func = star8_model
      grid_step = 2
      grid_size = 3
      
  3. Add tdlconf = trut.tdl.conf to your TRUT file.

  4. Check the TRUT file and trut.tdl.conf into svn.

Nested directives

Directives may be nested too (i.e. subtests within tests). In the near future, I will add the capability to run TDL jobs. You would then specify them as follows:

This specifies a TDL script to be compiled, and TDL jobs to be executed. Options again may be nested; the same rules apply (i.e. you can have settings that are local to a particular job, etc.)

In principle this syntax allows nesting of test directives to any level. For example, I anticipate sub-sub-tests, such as testing for particular node states within TDL jobs.

TRUT/WritingTrutFiles (last edited 2007-05-31 13:45:05 by OlegSmirnov)