doc and various fixes of lua for windows
This commit is contained in:
@@ -17,7 +17,7 @@ python_path_Linux: $(home)/tmp/tum_venv/bin/python3
|
||||
|
||||
LUA_PATH_Linux: /usr/share/lua/5.4/?.lua;/usr/local/share/lua/5.4/?.lua;/usr/local/share/lua/5.4/?/init.lua;/usr/share/lua/5.4/?/init.lua;/usr/local/lib/lua/5.4/?.lua;/usr/local/lib/lua/5.4/?/init.lua;/usr/lib/lua/5.4/?.lua;/usr/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua;/home/francois/.luarocks/share/lua/5.4/?.lua;/home/francois/.luarocks/share/lua/5.4/?/init.lua
|
||||
LUA_CPATH_Linux: /usr/local/lib/lua/5.4/?.so;/usr/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/loadall.so;/usr/lib/lua/5.4/loadall.so;./?.so;/home/francois/.luarocks/lib/lua/5.4/?.so
|
||||
PATH_Linux: ""
|
||||
PATH_Linux:
|
||||
|
||||
LUA_PATH_Windows: ;.\?.lua;C:\Lua\5.1\lua\?.lua;C:\Lua\5.1\lua\?\init.lua;C:\Lua\5.1\?.lua;C:\Lua\5.1\?\init.lua;C:\Lua\5.1\lua\?.luac
|
||||
LUA_CPATH_Windows: .\?.dll;C:\Lua\5.1\?.dll;C:\Lua\5.1\loadall.dll;C:\Lua\5.1\clibs\?.dll;C:\Lua\5.1\clibs\loadall.dll;.\?51.dll;C:\Lua\5.1\?51.dll;C:\Lua\5.1\clibs\?51.dll
|
||||
|
||||
@@ -13,7 +13,7 @@ Tests reports generation and customization are also in this tool's scope.
|
||||
Its main features are:
|
||||
|
||||
* YAML test description,
|
||||
* Test configuration files in YAML, JSON or XML,
|
||||
* Test configuration files in YAML,
|
||||
* Full range of pre-existing Test items,
|
||||
* Test steps, loops,
|
||||
* Dynamic variables expansion at test runtime,
|
||||
|
||||
@@ -62,4 +62,25 @@ on how to access to global variables from test items and scripts).
|
||||
|
||||
In the example above, the global variable ``$(lfn_activity)``
|
||||
would be created at the end of the item execution. It would contain the resulting
|
||||
value of the funcToBeExecuted python function.
|
||||
value of the funcToBeExecuted python function.
|
||||
|
||||
**Global variables**
|
||||
|
||||
Some global variables have an impact on the ``lua_func`` test item behavior:
|
||||
|
||||
* ``lua_path``: This optional global variable can be used to define
|
||||
the lua executable path. If not defined, the lua interpreter is
|
||||
searched in at the default place in the system.
|
||||
* ``lua_env``: This global variable can be used to define
|
||||
environment variables for the lua script execution environment.
|
||||
Only `PATH`, `LUA_PATH`, and `LUA_CPATH` are supported.
|
||||
|
||||
.. code-block:: yaml
|
||||
:caption: example of configuration file: param.yaml
|
||||
|
||||
[...]
|
||||
lua_env:
|
||||
PATH: "/my/path/"
|
||||
LUA_PATH: "/my/lua/modules/?.lua;;"
|
||||
LUA_CPATH: "/my/lua/modules/?.so;;"
|
||||
[...]
|
||||
|
||||
@@ -105,4 +105,12 @@ on how to access to global variables from test items and scripts).
|
||||
|
||||
In the example above, the global variable ``$(pfn_function test item)``
|
||||
would be created at the end of the item execution. It would contain the resulting
|
||||
value of the funcToBeExecuted python function.
|
||||
value of the funcToBeExecuted python function.
|
||||
|
||||
**Global variables**
|
||||
|
||||
Some global variables have an impact on the ``py_func`` test item behavior:
|
||||
|
||||
* ``python_path``: This optional global variable can be used to define
|
||||
the python executable path. If not defined, the python interpreter is
|
||||
searched in at the default places in the system.
|
||||
|
||||
@@ -36,60 +36,52 @@ The example below shows a basic implementation of the TUM description file:
|
||||
Configuration files
|
||||
--------------------
|
||||
|
||||
A configuration file can be specified in the .tum file or by the command line.
|
||||
This configuration file is optional.
|
||||
A configuration file can be specified in the `.tum` file or by the command line.
|
||||
This configuration file is optional and must be a YAML file.
|
||||
|
||||
It can be of three different syntax:
|
||||
|
||||
* XML
|
||||
* YAML
|
||||
* JSON
|
||||
|
||||
The type of file is recognized by the file name extension (.xml, .yaml, .json).
|
||||
The type of file is recognized by the file name extension `.yaml`.
|
||||
|
||||
During the test script loading process, the values defined in these configuration files
|
||||
are added to the global variables and are then accessible from the test items and scripts
|
||||
(cf. :ref:`global variables<sec_global_variables>`).
|
||||
|
||||
The parameter file can be specified in the .tum file root:
|
||||
The parameter file can be specified in the `.tum` file root:
|
||||
|
||||
.. code-block:: yaml
|
||||
:caption: configuration files definition
|
||||
:caption: configuration files definition in the main `.tum` test file
|
||||
|
||||
config_file:
|
||||
- myparam.xml
|
||||
- config1.json
|
||||
- config2.yaml
|
||||
config1.yaml
|
||||
config2.yaml
|
||||
|
||||
main:
|
||||
name: Test example
|
||||
[...]
|
||||
|
||||
If nothing is specified, the ``param.xml``, ``param.yaml`` and ``param.json``
|
||||
are automatically loaded, if present in the test directory.
|
||||
.. code-block:: yaml
|
||||
:caption: example of configuration file: param.yaml
|
||||
|
||||
parameter1: value1
|
||||
parameter2: 1234
|
||||
parameter3: <@ 12.34 * 2 @>
|
||||
parameter4:
|
||||
- $(parameter1)
|
||||
- $(parameter3)
|
||||
parameter5:
|
||||
sub_param1: sub_value1
|
||||
sub_param2: $(parameter4)
|
||||
|
||||
If nothing is specified, the ``param.yaml``
|
||||
is automatically loaded, if present in the test directory.
|
||||
|
||||
Files loading
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The ``JSON`` and ``YAML`` configuration files variables are evaluated directly.
|
||||
The ``YAML`` configuration files variables are evaluated directly and accessible from TUM
|
||||
tests description files and also from :ref:`python<sec_py_func_item>`
|
||||
and :ref:`lua<sec_py_func_item>` function test items.
|
||||
|
||||
The XML files content is evaluated as follows.
|
||||
|
||||
.. code-block:: xml
|
||||
:name: param.xml
|
||||
|
||||
<?xml version="1.0" ?>
|
||||
<root>
|
||||
<parameter name="param1" value="['abc', 'bcd']"/>
|
||||
<parameter name="param2" value="0x123454"/>
|
||||
<parameter name="param3" str="def"/>
|
||||
</root>
|
||||
|
||||
If the ``parameter`` XML item defines:
|
||||
|
||||
* ``value`` argument: its content is parsed for variable substitution
|
||||
(see :ref:`variables expansion<sec_variable_expansion>`) and then evaluated as a python statement,
|
||||
* ``str`` argument: its content is not evaluated and is kept as a string.
|
||||
See more details :ref:`below<sec_global_variables>`.
|
||||
|
||||
.. _sec_global_variables:
|
||||
|
||||
@@ -153,11 +145,32 @@ library API (see :ref:`helper library<sec_python_helper_library>`)
|
||||
:ref:`sec_loop_item`). If the loop number its value is the python constant
|
||||
``inf``.
|
||||
|
||||
Debug mode
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Debug mode can be enabled by defining the global variable `test_debug`.
|
||||
|
||||
For example, it can be defined in the configuration file as:
|
||||
|
||||
.. code-block:: yaml
|
||||
:caption: example of configuration file: param.yaml
|
||||
|
||||
[...]
|
||||
test_debug: True
|
||||
[.]
|
||||
|
||||
It can also be defined from the command line with the option
|
||||
``-d test_debug``.
|
||||
|
||||
When debug mode is enabled, additional information are displayed in the log window.
|
||||
|
||||
Some :ref:`helper library functions<sec_python_helper_library>` are availabe
|
||||
to give the state of the debug mode.
|
||||
|
||||
Test items entries
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
All test items attributes can be global variable entry;
|
||||
All test items attributes can be global variable entries;
|
||||
when using the entry ``$(<global>)`` before a key value, the corresponding
|
||||
key entry is searched within the global variables dataset.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user