Skip to content

Test Editor#

Tests are edited in Visual Studio Code with the Measmatic Test Editor extension. Editing tests requires the developer mode to be enabled in the program settings.

Opening a test#

A test is opened via Edit test in the context menu of the test library or the test sequence. Measmatic opens the Libraries folder of the Measmatic data directory in Visual Studio Code and shows the test file (*.mmtst) in the Measmatic Test Editor.

Before the first use, Measmatic checks the prerequisites:

  • Visual Studio Code must be installed (download).
  • The Measmatic Test Editor extension and the required Visual Studio Code extensions are installed or updated on request.

If a test of the project does not exist in the test library, Measmatic asks whether the test should be moved to the test library in order to edit it. If the project test and the library test have different revisions, Measmatic asks which version should be used.

Each test is stored in its own folder in the test library and consists of the test script (*.py), the test meta data (*.mmtst), the user interface (*.mmui, HTML), the test icon (*.png) and optionally the test documentation (*.md).

Properties#

The properties section contains the main properties of a test that are displayed in the test library: author, test type, category, test description, required Lua scripts, creation date, Measmatic version, revision and last modification date. The test icon can be replaced with Upload icon.

Required Lua scripts in VS Code#

For Lua tests, the VS Code metadata editor provides the optional Required Lua scripts field. Enter comma-separated filenames, for example FastSweep2600.lua, TDK/MatrixConfiguration.lua. Files are searched in Libraries/Tests/lib/Lua and its subdirectories. If a filename occurs more than once, specify its path relative to that directory. Absolute paths and paths outside the Lua directory are not supported. Spaces around entries and duplicate entries are ignored.

Measmatic loads and executes these dependencies in the listed order before transferring any Lua test scripts to the device. The requirements cover all Lua tests included in that transfer, including tests inside sequences. Python tests do not use this field.

A marker in each device's Lua state records the file and its content hash. Unchanged scripts already loaded by Measmatic are skipped, including additional scripts loaded during device initialization. Changed scripts and scripts missing after a restart are loaded again. A missing or ambiguous file, a transfer error or a Lua error prevents test startup. An empty field keeps the previous behavior and requires no additional device communication.

Output parameters#

The output parameters section contains all test output parameters with name, unit and unit prefix. Parameters can be added, removed and reordered.

User interface#

The user interface of a test is defined in the *.mmui file using HTML and the Measmatic UI components (see developer documentation). When a *.mmui file is opened, a live preview of the user interface is shown beside the HTML code.

Script code#

The test script is a Python file that is edited and debugged in Visual Studio Code. See How to create a Measmatic test, Structure of a test script and Debugging for details.

Applying changes#

Changes made in Visual Studio Code are detected by Measmatic. The status bar then shows "Test modified"; clicking it reloads the test library and updates the tests in the project (see test library menu).